示例#1
0
 def test_with_external_auth_strip_trailing_slash(self):
     Config.objects.set_config('external_auth_url', 'https://example.com/')
     request = factory.make_fake_request('/')
     middleware = ExternalAuthInfoMiddleware()
     middleware.process_request(request)
     self.assertEqual(request.external_auth_info.type, 'macaroon')
     self.assertEqual(request.external_auth_info.url, 'https://example.com')
示例#2
0
 def test_without_external_auth(self):
     request = factory.make_fake_request('/')
     middleware = ExternalAuthInfoMiddleware()
     middleware.process_request(request)
     self.assertIsNone(request.external_auth_info)