MCPcopy
hub / github.com/django/django / test_get_port

Method test_get_port

tests/requests_tests/tests.py:1463–1476  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1461
1462 @override_settings(USE_X_FORWARDED_PORT=False)
1463 def test_get_port(self):
1464 request = HttpRequest()
1465 request.META = {
1466 "SERVER_PORT": "8080",
1467 "HTTP_X_FORWARDED_PORT": "80",
1468 }
1469 # Shouldn't use the X-Forwarded-Port header
1470 self.assertEqual(request.get_port(), "8080")
1471
1472 request = HttpRequest()
1473 request.META = {
1474 "SERVER_PORT": "8080",
1475 }
1476 self.assertEqual(request.get_port(), "8080")
1477
1478 @override_settings(USE_X_FORWARDED_PORT=True)
1479 def test_get_port_with_x_forwarded_port(self):

Callers

nothing calls this directly

Calls 2

get_portMethod · 0.95
HttpRequestClass · 0.90

Tested by

no test coverage detected