1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #32790 -- Ensured test Client handles redirects to domain indexes without a specified trailing slash.

This commit is contained in:
tomhamiltonstubber
2021-05-27 11:44:42 +02:00
committed by Carlton Gibson
parent d54059ebce
commit 1e5aa8e1c7
4 changed files with 26 additions and 2 deletions

View File

@@ -762,6 +762,13 @@ class ClientTest(TestCase):
response = self.client.get('/django_project_redirect/')
self.assertRedirects(response, 'https://www.djangoproject.com/', fetch_redirect_response=False)
def test_external_redirect_without_trailing_slash(self):
"""
Client._handle_redirects() with an empty path.
"""
response = self.client.get('/no_trailing_slash_external_redirect/', follow=True)
self.assertRedirects(response, 'https://testserver')
def test_external_redirect_with_fetch_error_msg(self):
"""
assertRedirects without fetch_redirect_response=False raises