本文整理汇总了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))
示例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))
示例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))
示例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))
示例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))
示例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())
示例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))
示例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)
示例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))
示例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))
示例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))