コード例 #1
0
def test_anonymous_user(app_):
    assert AnonymousUser().is_authenticated is False
    assert AnonymousUser().logged_in_elsewhere() is False
    assert AnonymousUser().default_organisation.name is None
    assert AnonymousUser().default_organisation.crown is None
    assert AnonymousUser().default_organisation.agreement_signed is None
    assert AnonymousUser().default_organisation.domains == []
    assert AnonymousUser().default_organisation.organisation_type is None
    assert AnonymousUser().default_organisation.request_to_go_live_notes is None
コード例 #2
0
 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))