diff options
| author | Jannis Leidel <jannis@leidel.info> | 2012-03-02 22:35:26 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2012-03-02 22:35:26 +0000 |
| commit | 126d9e1b499663e72cc795906bdbcd333aceaf0a (patch) | |
| tree | 8aba4dea4c5f579688be2355233e7ee1056f2e20 /tests | |
| parent | b9bf7cce896a4886f77b2162042a6fb676463b86 (diff) | |
Fixed #17817 -- Modified LocalMiddleware to use full URLs when redirecting to i18n URLs. Thanks to Paul for keeping an eye on the standards.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17633 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/i18n/patterns/tests.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/regressiontests/i18n/patterns/tests.py b/tests/regressiontests/i18n/patterns/tests.py index 1216d0bde9..16fbec014a 100644 --- a/tests/regressiontests/i18n/patterns/tests.py +++ b/tests/regressiontests/i18n/patterns/tests.py @@ -182,12 +182,10 @@ class URLRedirectWithoutTrailingSlashTests(URLTestCaseBase): self.assertRedirects(response, '/not-prefixed/', 301) def test_en_redirect(self): - response = self.client.get('/account/register', HTTP_ACCEPT_LANGUAGE='en') + response = self.client.get('/account/register', HTTP_ACCEPT_LANGUAGE='en', follow=True) # target status code of 301 because of CommonMiddleware redirecting - self.assertRedirects(response, '/en/account/register', 302, target_status_code=301) - - response = self.client.get(response['location']) - self.assertRedirects(response, '/en/account/register/', 301) + self.assertIn(('http://testserver/en/account/register/', 301), response.redirect_chain) + self.assertRedirects(response, '/en/account/register/', 302) class URLRedirectWithoutTrailingSlashSettingTests(URLTestCaseBase): |
