当前位置: 首页>>代码示例>>Python>>正文


Python pytest_ringo.transaction_begin函数代码示例

本文整理汇总了Python中pytest_ringo.transaction_begin函数的典型用法代码示例。如果您正苦于以下问题:Python transaction_begin函数的具体用法?Python transaction_begin怎么用?Python transaction_begin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了transaction_begin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: 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

示例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_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

示例5: test_delete_POST_admin_confirm_yes

 def test_delete_POST_admin_confirm_yes(self, app):
     """Admin user can not delete himself. This triggers a circular
     dependecy which is handled with the fix of #5"""
     login(app, "admin", "secret")
     transaction_begin(app)
     values = {"confirmed": 1}
     app.post("/users/delete/1", params=values, status=200)
开发者ID:ringo-framework,项目名称:ringo,代码行数:7,代码来源:test_user.py

示例6: 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

示例7: 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

示例8: 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

示例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_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

示例12: 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

示例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


注:本文中的pytest_ringo.transaction_begin函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。