• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python pytest_ringo.login函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了login函数的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):
     """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


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


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


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


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


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

 def test_delete_POST_confirm_yes(self, app):
     """Test if a created user can be deleted. The transaction is not
     actived here. As this seems to cause errors"""
     login(app, "admin", "secret")
     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]
     values = {"confirmed": 1}
     app.post("/users/delete/%s" % id, params=values, status=302)
开发者ID:mjsorribas,项目名称:ringo,代码行数:13,代码来源: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_GET

 def test_GET(self, app):
     login(app, "admin", "secret")
     app.get("/forms/list")
开发者ID:mjsorribas,项目名称:ringo,代码行数:3,代码来源:test_forms.py


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


示例18: test_update

 def test_update(self, app):
     login(app, "admin", "secret")
     app.get("/forms/update/1")
开发者ID:mjsorribas,项目名称:ringo,代码行数:3,代码来源:test_forms.py


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


示例20: test_GET

 def test_GET(self, app):
     """Creating of new modules is not supported in the webinterface"""
     login(app, "admin", "secret")
     app.get("/modules/create", status=404)
开发者ID:ringo-framework,项目名称:ringo,代码行数:4,代码来源:test_modules.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python pytest_ringo.transaction_begin函数代码示例发布时间:2022-05-27
下一篇:
Python utils.update_store函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap