def test_falls_through_to_challenge(self): request = self.DummyRequest('basic', 'other_user', 'other_pass') result = self.middleware.process_request(request) self.assertEqual(result.status_code, basic_auth.challenge().status_code)
def test_no_http_auth_in_meta(self): request = self.DummyRequest(None) result = self.middleware.process_request(request) self.assertEqual(result.status_code, basic_auth.challenge().status_code)
def test_challenge(self): response = basic_auth.challenge() self.assertEqual(response.status_code, 401) self.assertEqual(response['WWW-Authenticate'], 'Basic realm="Restricted Access"')