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')
def test_without_external_auth(self): request = factory.make_fake_request('/') middleware = ExternalAuthInfoMiddleware() middleware.process_request(request) self.assertIsNone(request.external_auth_info)