Пример #1
0
 def test_get_user_not_exist(self):
     """get_user() returns a user"""
     # make backend
     tb = TokenBackend()
     user = tb.get_user(8)
     # user is None
     self.assertEqual(user, None)
Пример #2
0
 def test_get_user_exist(self):
     """get_user() returns a user"""
     u = User()
     u.is_active = True
     u.email = '*****@*****.**'
     u.save()
     # make backend
     tb = TokenBackend()
     user = tb.get_user(u.id)
     # user is same as u
     self.assertEqual(user.id, u.id)