def test_can_properly_handle_an_invalid_username(self): # Setup User.objects.create_user( username='******', email='*****@*****.**', password='******') backend = EmailBackend() # Run & check self.assertIsNone(backend.authenticate(username='******', password='******'))
def test_can_authenticate_a_user_using_his_username(self): # Setup user = User.objects.create_user( username='******', email='*****@*****.**', password='******') backend = EmailBackend() # Run & check self.assertEqual( backend.authenticate(username='******', password='******'), user)
def test_can_properly_handle_an_invalid_username(self): # Setup User.objects.create_user(username='******', email='*****@*****.**', password='******') backend = EmailBackend() # Run & check self.assertIsNone( backend.authenticate(username='******', password='******'))
def test_can_properly_handle_multiple_users_with_the_same_email_address(self): # Setup User.objects.create_user( username='******', email='*****@*****.**', password='******') User.objects.create_user( username='******', email='*****@*****.**', password='******') backend = EmailBackend() # Run & check self.assertIsNone( backend.authenticate(username='******', password='******'))
def test_can_authenticate_a_user_using_his_email_address(self): # Setup user = User.objects.create_user(username='******', email='*****@*****.**', password='******') backend = EmailBackend() # Run & check self.assertEqual( backend.authenticate(username='******', password='******'), user)
def test_can_properly_handle_multiple_users_with_the_same_email_address( self): # Setup User.objects.create_user(username='******', email='*****@*****.**', password='******') User.objects.create_user(username='******', email='*****@*****.**', password='******') backend = EmailBackend() # Run & check self.assertIsNone( backend.authenticate(username='******', password='******'))