def test_proxy_invalid(self): request = HttpRequest() request.META['REMOTE_ADDR'] = '1.2.3.4' request.META['HTTP_X_FORWARDED_FOR'] = '2.3.4' middleware = ProxyMiddleware(self.get_response) self.assertEqual(middleware(request), 'response')
def test_proxy_invalid(self): request = HttpRequest() request.META["REMOTE_ADDR"] = "1.2.3.4" request.META["HTTP_X_FORWARDED_FOR"] = "2.3.4" middleware = ProxyMiddleware(self.get_response) self.assertEqual(middleware(request), "response")
def test_direct(self): request = HttpRequest() request.META['REMOTE_ADDR'] = '1.2.3.4' middleware = ProxyMiddleware(self.get_response) self.assertEqual(middleware(request), 'response')
def test_direct(self): request = HttpRequest() request.META["REMOTE_ADDR"] = "1.2.3.4" middleware = ProxyMiddleware(self.get_response) self.assertEqual(middleware(request), "response")