def test_returns_none_if_password_does_not_match(self):
        travis = generate_email_only_user()
        auth = EmailOnlyBackend()
        user = auth.authenticate(username='******', password='******')

        self.assertEqual(None, user)
        travis.delete()
    def test_returns_user_if_found(self):
        travis = generate_email_only_user()
        auth = EmailOnlyBackend()
        user = auth.authenticate(username = '******', password='******')

        self.assert_(isinstance(user, User))
        self.assertEqual(user, travis)

        travis.delete()
 def test_falls_back_on_real_username_if_email_not_found(self):
     chris = generate_username_only_user()
     auth = EmailOnlyBackend()
     user = auth.authenticate(username='******', password='******')
     self.assertEqual(user, chris)
 def test_returns_none_if_user_not_found(self):
     auth = EmailOnlyBackend()
     self.assertEqual(None, auth.authenticate(username='******', password='******'))
 def test_returns_none_if_no_password_is_provided(self):
     auth = EmailOnlyBackend()
     self.assertEqual(None, auth.authenticate(username='******'))
 def test_returns_none_if_nothing_provided(self):
     auth = EmailOnlyBackend()
     self.assertEqual(None, auth.authenticate())