class AuthenticateTest(TestCase): def setUp(self): User.objects.create_user(email='*****@*****.**', password='******') self.backend = ParanoidAuthenticationBackend() def test_can_authenticate_valid_user(self): user = self.backend.authenticate(email='*****@*****.**', password='******') self.assertIsNotNone(user) def test_wont_authenticate_user_with_wrong_password(self): user = self.backend.authenticate(email='*****@*****.**', password='') self.assertIsNone(user) def test_wont_authenticate_inexisting_user(self): user = self.backend.authenticate(email='*****@*****.**', password='******') self.assertIsNone(user)
def setUp(self): User.objects.create_user(email='*****@*****.**', password='******') self.backend = ParanoidAuthenticationBackend()