示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 def test_challenge(self):
     response = basic_auth.challenge()
     self.assertEqual(response.status_code, 401)
     self.assertEqual(response['WWW-Authenticate'], 'Basic realm="Restricted Access"')
示例#4
0
 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)
示例#5
0
 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)
示例#6
0
 def test_challenge(self):
     response = basic_auth.challenge()
     self.assertEqual(response.status_code, 401)
     self.assertEqual(response['WWW-Authenticate'],
                      'Basic realm="Restricted Access"')