diff options
Diffstat (limited to 'tests/test_client/tests.py')
| -rw-r--r-- | tests/test_client/tests.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_client/tests.py b/tests/test_client/tests.py index 402f282588..15f5cbe44e 100644 --- a/tests/test_client/tests.py +++ b/tests/test_client/tests.py @@ -856,6 +856,13 @@ class ClientTest(TestCase): response, "https://www.djangoproject.com/", fetch_redirect_response=False ) + @override_settings(ALLOWED_HOSTS=["hostname1", "hostname2"]) + def test_redirect_with_http_host(self): + response = self.client.get( + "/redirect_to_different_hostname/", follow=True, HTTP_HOST="hostname1" + ) + self.assertEqual(response.content, b"hostname2") + def test_external_redirect_without_trailing_slash(self): """ Client._handle_redirects() with an empty path. |
