本文整理汇总了Python中pytest_ringo.transaction_rollback函数的典型用法代码示例。如果您正苦于以下问题:Python transaction_rollback函数的具体用法?Python transaction_rollback怎么用?Python transaction_rollback使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了transaction_rollback函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_POST_existing_group
def test_POST_existing_group(self, app):
# FIXME: https://github.com/ringo-framework/ringo/issues/4 (ti) <2016-01-18 16:46>
login(app, "admin", "secret")
transaction_begin(app)
values = {"name": "admins"}
app.post("/usergroups/create", params=values, status=200)
transaction_rollback(app)
开发者ID:ringo-framework,项目名称:ringo,代码行数:7,代码来源:test_usergroup.py
示例2: test_delete_POST_admin_confirm_yes
def test_delete_POST_admin_confirm_yes(self, app):
# FIXME: https://github.com/ringo-framework/ringo/issues/5 (ti) <2016-01-18 16:46>
login(app, "admin", "secret")
transaction_begin(app)
values = {"confirmed": 1}
app.post("/usergroups/delete/1", params=values, status=302)
transaction_rollback(app)
开发者ID:mjsorribas,项目名称:ringo,代码行数:7,代码来源:test_usergroup.py
示例3: test_update_POST_missing_label_plural
def test_update_POST_missing_label_plural(self, app):
login(app, "admin", "secret")
transaction_begin(app)
values = {"name": "modules", "label": "Modul",
"label_plural": ""}
app.post("/modules/update/1", params=values, status=200)
transaction_rollback(app)
开发者ID:ringo-framework,项目名称:ringo,代码行数:7,代码来源:test_modules.py
示例4: test_unauthenticated
def test_unauthenticated(self, app):
"""Methods is called as unautheticated user"""
logout(app)
transaction_begin(app)
app.get("/users/removeaccount/1", status=401)
app.get("/")
transaction_rollback(app)
开发者ID:ringo-framework,项目名称:ringo,代码行数:7,代码来源:test_user.py
示例5: test_change_password_tooshort
def test_change_password_tooshort(self, app):
login(app, "admin", "secret")
transaction_begin(app)
values = {"login": "admin", "oldpassword": "secret",
"password": "123123123",
"_retype_password": "123123123"}
result = app.post("/users/changepassword/1", params=values, status=200)
transaction_rollback(app)
开发者ID:mjsorribas,项目名称:ringo,代码行数:8,代码来源:test_user.py
示例6: test_delete_POST_admin_confirm_yes
def test_delete_POST_admin_confirm_yes(self, app):
"""admin user group can not be deleted see
https://github.com/ringo-framework/ringo/issues/5 for more
details."""
login(app, "admin", "secret")
transaction_begin(app)
values = {"confirmed": 1}
app.post("/usergroups/delete/1", params=values, status=200)
transaction_rollback(app)
开发者ID:ringo-framework,项目名称:ringo,代码行数:9,代码来源:test_usergroup.py
示例7: test_POST
def test_POST(self, app):
login(app, "admin", "secret")
transaction_begin(app)
create_user(app, "test")
udata = search_data(app, "users", "login", "test")
gdata = search_data(app, "usergroups", "name", "test")
# Check that the default_gid is set to the users usergroup
assert gdata.get("id") == udata.get("default_gid")
transaction_rollback(app)
开发者ID:ringo-framework,项目名称:ringo,代码行数:9,代码来源:test_user.py
示例8: test_setstandin
def test_setstandin(self, app):
user = search_data(app, "users", "login", "test123")
app.get("/usergroups/setstandin/%s" % user["default_gid"])
admin = search_data(app, "users", "login", "admin")
app.post("/usergroups/setstandin/%s" % user["default_gid"],
params={"members": [admin["id"], user["id"]]}, status=302)
app.get("/")
transaction_rollback(app)
开发者ID:mjsorribas,项目名称:ringo,代码行数:10,代码来源:test_user.py
示例9: test_POST_existing_user
def test_POST_existing_user(self, app):
login(app, "admin", "secret")
transaction_begin(app)
values = {"login": "admin",
"password": "123123123qwe",
"_retype_password": "123123123qwe",
"_first_name": u"Först", "_last_name": "Last",
"_email": "[email protected]"}
app.post("/users/create", params=values, status=200)
transaction_rollback(app)
开发者ID:mjsorribas,项目名称:ringo,代码行数:10,代码来源:test_user.py
示例10: test_remove_permission
def test_remove_permission(self, app):
login(app, "admin", "secret")
transaction_begin(app)
values = {"label": "Users", "name": "user", "permissions": [21,30],
"admin": "False"}
app.post("/roles/update/1", params=values, status=302)
values = {"label": "Users", "name": "user", "permissions": [21],
"admin": "False"}
app.post("/roles/update/1", params=values, status=302)
transaction_rollback(app)
开发者ID:ringo-framework,项目名称:ringo,代码行数:11,代码来源:test_roles.py
示例11: test_create
def test_create(self, app):
login(app, "admin", "secret")
transaction_begin(app)
create_user(app, "test")
user = search_data(app, "users", "login", "test")
user["login"] = "test123"
app.post("/users/update/%s" % user["id"], params=user, status=302)
usergroup = search_data(app, "usergroups", "name", user["login"])
assert usergroup
app.get("/")
transaction_rollback(app)
开发者ID:mjsorribas,项目名称:ringo,代码行数:11,代码来源:test_user.py
示例12: test_unauthorized
def test_unauthorized(self, app):
"""Method is called with a different uid than the id uf the
current user. This is not allowed the users are only allowed to
delete their own account."""
login(app, "admin", "secret")
transaction_begin(app)
create_user(app, "test")
user = search_data(app, "users", "login", "test")
app.get("/users/removeaccount/%s" % user["id"], params=user, status=403)
app.get("/")
transaction_rollback(app)
开发者ID:ringo-framework,项目名称:ringo,代码行数:11,代码来源:test_user.py
示例13: test_delete
def test_delete(self, app):
login(app, "admin", "secret")
transaction_begin(app)
values = {"login": "test",
"password": "123123123qwe",
"_retype_password": "123123123qwe",
"_first_name": u"Först", "_last_name": "Last",
"_email": "[email protected]"}
result = app.post("/users/create", params=values, status=302)
id = result.headers["Location"].split("/")[-1]
app.get("/users/delete/%s" % id)
app.get("/users/list")
transaction_rollback(app)
开发者ID:mjsorribas,项目名称:ringo,代码行数:13,代码来源:test_user.py
示例14: test_confirmed
def test_confirmed(self, app):
"""User must confirm the deletion twice"""
transaction_begin(app)
login(app, "admin", "secret")
create_user(app, "test")
user = search_data(app, "users", "login", "test")
login(app, "test", "123123123qwe")
app.get("/users/removeaccount/%s" % user["id"], status=200)
params = {"_confirm_remove_account2": ["1"], "_confirm_remove_account": ["1"]}
app.post("/users/removeaccount/%s" % user["id"], params=params, status=302)
app.get("/")
transaction_rollback(app)
开发者ID:ringo-framework,项目名称:ringo,代码行数:14,代码来源:test_user.py
示例15: test_update_POST_missing_title
def test_update_POST_missing_title(self, app):
login(app, "admin", "secret")
transaction_begin(app)
values = {"title": "", "definiton": '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'}
app.post("/forms/update/1", params=values, status=200)
transaction_rollback(app)
开发者ID:mjsorribas,项目名称:ringo,代码行数:6,代码来源:test_forms.py
示例16: test_POST
def test_POST(self, app):
login(app, "admin", "secret")
transaction_begin(app)
values = {"title": "test", "definiton": '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'}
app.post("/forms/create", params=values, status=302)
transaction_rollback(app)
开发者ID:mjsorribas,项目名称:ringo,代码行数:6,代码来源:test_forms.py
示例17: test_delete
def test_delete(self, app):
"""Deleting of modules is not supported in the webinterface"""
login(app, "admin", "secret")
transaction_begin(app)
app.get("/modules/delete/1", status=404)
transaction_rollback(app)
开发者ID:ringo-framework,项目名称:ringo,代码行数:6,代码来源:test_modules.py
示例18: test_update_POST
def test_update_POST(self, app):
login(app, "admin", "secret")
transaction_begin(app)
values = {"email": "[email protected]"}
app.post("/profiles/update/1", params=values, status=302)
transaction_rollback(app)
开发者ID:mjsorribas,项目名称:ringo,代码行数:6,代码来源:test_profiles.py
示例19: test_update_POST_missing_name
def test_update_POST_missing_name(self, app):
login(app, "admin", "secret")
transaction_begin(app)
values = {"name": ""}
app.post("/usergroups/update/1", params=values, status=200)
transaction_rollback(app)
开发者ID:ringo-framework,项目名称:ringo,代码行数:6,代码来源:test_usergroup.py
示例20: test_update_POST_missing_email
def test_update_POST_missing_email(self, app):
login(app, "admin", "secret")
transaction_begin(app)
values = {"email": ""}
app.post("/profiles/update/1", params=values, status=200)
transaction_rollback(app)
开发者ID:mjsorribas,项目名称:ringo,代码行数:6,代码来源:test_profiles.py
注:本文中的pytest_ringo.transaction_rollback函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论