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


Python AnonymousUser.can方法代码示例

本文整理汇总了Python中app.models.AnonymousUser.can方法的典型用法代码示例。如果您正苦于以下问题:Python AnonymousUser.can方法的具体用法?Python AnonymousUser.can怎么用?Python AnonymousUser.can使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app.models.AnonymousUser的用法示例。


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

示例1: test_anonymous_user

# 需要导入模块: from app.models import AnonymousUser [as 别名]
# 或者: from app.models.AnonymousUser import can [as 别名]
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.FOLLOW))
     self.assertFalse(u.can(Permission.COMMENT))
     self.assertFalse(u.can(Permission.WRITE))
     self.assertFalse(u.can(Permission.MODERATE))
     self.assertFalse(u.can(Permission.ADMIN))
开发者ID:Chris0325,项目名称:flasky,代码行数:9,代码来源:test_user_model.py

示例2: test_anonymous_user

# 需要导入模块: from app.models import AnonymousUser [as 别名]
# 或者: from app.models.AnonymousUser import can [as 别名]
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.FOLLOW))
开发者ID:viprs,项目名称:FlaskyBlog,代码行数:5,代码来源:test_user_model.py

示例3: test_anonymous_user

# 需要导入模块: from app.models import AnonymousUser [as 别名]
# 或者: from app.models.AnonymousUser import can [as 别名]
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.WRITE_ARTICLES))
开发者ID:awayz,项目名称:python_blog,代码行数:5,代码来源:test_user_model.py

示例4: test_anonymous_user

# 需要导入模块: from app.models import AnonymousUser [as 别名]
# 或者: from app.models.AnonymousUser import can [as 别名]
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.COMMENT))
开发者ID:coreki,项目名称:FirstFlask-Bilin,代码行数:5,代码来源:test_user_model.py

示例5: test_anonymous_user

# 需要导入模块: from app.models import AnonymousUser [as 别名]
# 或者: from app.models.AnonymousUser import can [as 别名]
 def test_anonymous_user(self):
     """testing ---> anonymous user"""
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.WRITE_ARTICLES))
开发者ID:CludeX,项目名称:guisheng2,代码行数:6,代码来源:test_user_model.py

示例6: test_anonymous_user

# 需要导入模块: from app.models import AnonymousUser [as 别名]
# 或者: from app.models.AnonymousUser import can [as 别名]
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.UPLOAD))
     self.assertFalse(u.is_administrator())
开发者ID:dakotabenjamin,项目名称:WebODM,代码行数:6,代码来源:test_user_model.py

示例7: test_anonymous_user

# 需要导入模块: from app.models import AnonymousUser [as 别名]
# 或者: from app.models.AnonymousUser import can [as 别名]
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.ADMINISTER))
开发者ID:charlestondance,项目名称:FlaskStartUp,代码行数:5,代码来源:test_user_model.py

示例8: test_anonymous

# 需要导入模块: from app.models import AnonymousUser [as 别名]
# 或者: from app.models.AnonymousUser import can [as 别名]
 def test_anonymous(self):
     u = AnonymousUser()
     assert not u.can(Permissions.LIKE)
开发者ID:nicoplus,项目名称:nicoplus_blog,代码行数:5,代码来源:test_user_model.py

示例9: test_anonymous

# 需要导入模块: from app.models import AnonymousUser [as 别名]
# 或者: from app.models.AnonymousUser import can [as 别名]
 def test_anonymous(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.GENERAL))
开发者ID:ColinHaley,项目名称:PTFMapper,代码行数:5,代码来源:test_user_model.py

示例10: test_anonymous_user

# 需要导入模块: from app.models import AnonymousUser [as 别名]
# 或者: from app.models.AnonymousUser import can [as 别名]
 def test_anonymous_user(self):
     """Permissions are correctly applied for anonymous users."""
     user = AnonymousUser()
     self.assertFalse(user.can(Permission.VIEW_CONTENT))
开发者ID:sandogeorge,项目名称:nsga1516,代码行数:6,代码来源:test_user_model.py

示例11: test_anonymous_user

# 需要导入模块: from app.models import AnonymousUser [as 别名]
# 或者: from app.models.AnonymousUser import can [as 别名]
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.CHALLENGE))
开发者ID:Qumeric,项目名称:instabattle,代码行数:5,代码来源:test_user_model.py


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