diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_client/tests.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_client/tests.py b/tests/test_client/tests.py index 1836dd49c5..9b9c11d9c6 100644 --- a/tests/test_client/tests.py +++ b/tests/test_client/tests.py @@ -217,6 +217,18 @@ class ClientTest(TestCase): self.assertRedirects(response, '/get_view/', status_code=302, target_status_code=200) self.assertEqual(len(response.redirect_chain), 2) + def test_follow_relative_redirect(self): + "A URL with a relative redirect can be followed." + response = self.client.get('/accounts/', follow=True) + self.assertEqual(response.status_code, 200) + self.assertEqual(response.request['PATH_INFO'], '/accounts/login/') + + def test_follow_relative_redirect_no_trailing_slash(self): + "A URL with a relative redirect with no trailing slash can be followed." + response = self.client.get('/accounts/no_trailing_slash', follow=True) + self.assertEqual(response.status_code, 200) + self.assertEqual(response.request['PATH_INFO'], '/accounts/login/') + def test_redirect_http(self): "GET a URL that redirects to an http URI" response = self.client.get('/http_redirect_view/', follow=True) |
