diff options
Diffstat (limited to 'tests/test_client/tests.py')
| -rw-r--r-- | tests/test_client/tests.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_client/tests.py b/tests/test_client/tests.py index 1c43a2957e..3db42cb1c2 100644 --- a/tests/test_client/tests.py +++ b/tests/test_client/tests.py @@ -601,7 +601,13 @@ class ClientTest(TestCase): a relevant ValueError rather than a non-descript AssertionError. """ response = self.client.get('/django_project_redirect/') - with self.assertRaisesMessage(ValueError, 'unable to fetch'): + msg = ( + "The test client is unable to fetch remote URLs (got " + "https://www.djangoproject.com/). If the host is served by Django, " + "add 'www.djangoproject.com' to ALLOWED_HOSTS. " + "Otherwise, use assertRedirects(..., fetch_redirect_response=False)." + ) + with self.assertRaisesMessage(ValueError, msg): self.assertRedirects(response, 'https://www.djangoproject.com/') def test_session_modifying_view(self): |
