def test_is_authenticated_failure_wrong_credentials(self): request = self.DummyRequest('basic', 'other_user', 'other_pass') result = basic_auth.is_authenticated(request.META['HTTP_AUTHORIZATION']) self.assertFalse(result)
def test_authenticate_failure_wrong_type(self): request = self.DummyRequest('non_basic', 'user', 'pass') result = basic_auth.is_authenticated(request.META['HTTP_AUTHORIZATION']) self.assertEqual(result, None)
def test_is_authenticated_success(self): request = self.DummyRequest('basic', 'user', 'pass') result = basic_auth.is_authenticated(request.META['HTTP_AUTHORIZATION']) self.assertTrue(result)
def test_is_authenticated_failure_wrong_credentials(self): request = self.DummyRequest('basic', 'other_user', 'other_pass') result = basic_auth.is_authenticated( request.META['HTTP_AUTHORIZATION']) self.assertFalse(result)
def test_authenticate_failure_wrong_type(self): request = self.DummyRequest('non_basic', 'user', 'pass') result = basic_auth.is_authenticated( request.META['HTTP_AUTHORIZATION']) self.assertEqual(result, None)
def test_is_authenticated_success(self): request = self.DummyRequest('basic', 'user', 'pass') result = basic_auth.is_authenticated( request.META['HTTP_AUTHORIZATION']) self.assertTrue(result)