本文整理汇总了Python中app.models.AnonymousUser类的典型用法代码示例。如果您正苦于以下问题:Python AnonymousUser类的具体用法?Python AnonymousUser怎么用?Python AnonymousUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AnonymousUser类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_anonymous_user
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
def test_anonymous_user(self):
u = AnonymousUser()
self.assertFalse(u.can(Permission.FOLLOW))
示例3: test_anonymous_user
def test_anonymous_user(self):
u = AnonymousUser()
self.assertFalse(u.can(Permission.WRITE_ARTICLES))
示例4: test_anonymous_user
def test_anonymous_user(self):
u = AnonymousUser()
self.assertFalse(u.can(Permission.COMMENT))
示例5: test_anonymous_user
def test_anonymous_user(self):
"""testing ---> anonymous user"""
u = AnonymousUser()
self.assertFalse(u.can(Permission.WRITE_ARTICLES))
示例6: test_anonymous_user
def test_anonymous_user(self):
u = AnonymousUser()
self.assertFalse(u.can(Permission.UPLOAD))
self.assertFalse(u.is_administrator())
示例7: test_anonymous_user
def test_anonymous_user(self):
u = AnonymousUser()
self.assertFalse(u.can(Permission.ADMINISTER))
示例8: test_anonymous_user
def test_anonymous_user(self):
u = AnonymousUser()
self.assertFalse(u.is_administrator())
示例9: test_anonymous
def test_anonymous(self):
u = AnonymousUser()
assert not u.can(Permissions.LIKE)
示例10: test_anonymous
def test_anonymous(self):
u = AnonymousUser()
self.assertFalse(u.can(Permission.GENERAL))
示例11: test_anonymous_user
def test_anonymous_user(self):
"""Permissions are correctly applied for anonymous users."""
user = AnonymousUser()
self.assertFalse(user.can(Permission.VIEW_CONTENT))
示例12: test_anonymous_user
def test_anonymous_user(self):
u = AnonymousUser()
self.assertFalse(u.can(Permission.CHALLENGE))