示例#1
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))
示例#2
0
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.WRITE))
     self.assertFalse(u.can(Permission.MODERATE))
     self.assertFalse(u.can(Permission.ADMIN))
示例#3
0
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.is_allowed(Permission.BASIC))
示例#4
0
 def test_is_administrator(self):
     u = AnonymousUser()
     assert not u.is_administrator()
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.CREATE_POSTS))
示例#6
0
 def test_anonymous_user_is_not_driver(self):
     carpool = CarpoolFactory()
     anonymous = AnonymousUser()
     assert anonymous.is_driver(carpool) == False
示例#7
0
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.CHALLENGE))
示例#8
0
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.FOLLOW))
示例#9
0
 def test_anonymous_user(self):
     user = AnonymousUser()
     self.assertFalse(user.can(Permission.WRITE_ARTICLES))
示例#10
0
 def test_anonymous_user(self):
     u = AnonymousUser()
     for perm in ["FOLLOW", "COMMENT", "WRITE", "MODERATE", "ADMIN"]:
         self.assertFalse(u.can(getattr(Permission, perm)))
示例#11
0
 def test_anonymouruser(self):
     user0 = AnonymousUser()
     self.assertFalse(user0.can(RolePermissionCode.USER))
     self.assertFalse(user0.can(RolePermissionCode.MODERATOR))
示例#12
0
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertTrue(u.can(Permission.COMMENT))
示例#13
0
 def test_anonymous_user(self):
     """Permissions are correctly applied for anonymous users."""
     user = AnonymousUser()
     self.assertFalse(user.can(Permission.VIEW_CONTENT))
示例#14
0
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertTrue(u.can(Permission.BUY))
     self.assertFalse(u.can(Permission.VIEW))
     self.assertFalse(u.can(Permission.ADMIN))
示例#15
0
 def test_anonymous(self):
     u = AnonymousUser()
     assert not u.can(Permissions.LIKE)
示例#16
0
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.POST_ACTIVITIES))
示例#17
0
 def test_anonymous(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.GENERAL))
示例#18
0
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.WRITE_ARTICLES))
示例#19
0
 def test_anonymous(self):
     u = AnonymousUser()
     assert not u.can(Permissions.LIKE)
示例#20
0
 def test_anonymous_user_has_no_ride_request(self):
     carpool = CarpoolFactory()
     anonymous = AnonymousUser()
     assert anonymous.get_ride_request_in_carpool(carpool) == None
 def test_anonymous(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.WRITE_ARTICLE))
示例#22
0
 def test_anonymous(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.GENERAL))
示例#23
0
	def test_anonymous_user(self):
		u = AnonymousUser()
		self.assertFalse(u.is_administrator())
示例#24
0
 def test_anonymous_user(self):
     """testing ---> anonymous user"""
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.WRITE_ARTICLES))
示例#25
0
 def test_anonymous_user(self):
     user = AnonymousUser()
     self.assertFalse(user.can(Permissions.ADDNOTES))
     self.assertFalse(user.can(Permissions.ADMIN))
     self.assertFalse(user.can(Permissions.MYNOTES))
示例#26
0
 def test_user_can(self):
     u = AnonymousUser()
     assert not u.can('default')
 def test_anonymous_user(self):
     """Test the permissions of an anonymous user."""
     user = AnonymousUser()
     self.assertFalse(user.can(Permission.ADMIN))
     self.assertFalse(user.can(Permission.SPONSOR_EVENT))
     self.assertFalse(user.can(Permission.CREATE_EVENT))
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.SAVE_ENTRY))
示例#29
0
 def test_anonymous_user_permissions(self):
     user = AnonymousUser()
     self.assertFalse(user.can(Permission.WRITE_CONTENT))
     self.assertFalse(user.can(Permission.REVIEW_CONTENT))
     self.assertFalse(user.can(Permission.PUBLISH_CONTENT))
     self.assertFalse(user.is_administrator())
示例#30
0
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.PATIENT_PERMISSION))
示例#31
0
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.WRITE_ARTICLES))
     self.assertFalse(u.can(Permission.COMMENT))
示例#32
0
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.FOLLOW))
     self.assertFalse(u.is_administrator())
示例#33
0
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.ADMINISTER))
示例#34
0
 def test_anonymoususers_permission(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.COMMENT))
示例#35
0
def login_test():
    if g.current_user == AnonymousUser():
        return jsonify(status='error', data='Anonymous user!'), 401
    else:
        return jsonify(email=g.current_user.email, status='success')
示例#36
0
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.COMMENT))
示例#37
0
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.UPLOAD))
     self.assertFalse(u.is_administrator())
示例#38
0
 def test_anonymous_user(self):
     u = AnonymousUser()
     self.assertFalse(u.can(Permission.FOLLOW))
示例#39
0
 def test_anonymous_user(self):
     u = AnonymousUser()  # 不管是什么,这个实例的方法,返回的都是False
     self.assertFalse(u.can(Permission.FOLLOW))