Пример #1
0
 def test_gets_user_by_email(self):
     backend = PersonalAuthenticationBackend()
     other_user = User(email='*****@*****.**')
     other_user.username = '******'
     other_user.save()
     desired_user = User.objects.create(email='*****@*****.**')
     found_user = backend.get_user('*****@*****.**')
     self.assertEqual(found_user, desired_user)
Пример #2
0
 def test_gets_user_by_email(self, mock_post):
     backend = PersonalAuthenticationBackend()
     desired_user = User.objects.create(email=TEST_EMAIL)
     found_user = backend.get_user(TEST_EMAIL)
     self.assertEqual(desired_user,found_user)
Пример #3
0
 def test_returns_none_if_no_user_with_that_email(self):
     backend = PersonalAuthenticationBackend()
     self.assertIsNone(backend.get_user('*****@*****.**'))