mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #19910 -- Added slash to i18n redirect if APPEND_SLASH is set.
This introduces a force_append_slash argument for request.get_full_path() which is used by RedirectFallbackMiddleware and CommonMiddleware when handling redirects for settings.APPEND_SLASH.
This commit is contained in:
@@ -247,8 +247,8 @@ class URLRedirectWithoutTrailingSlashTests(URLTestCaseBase):
|
||||
|
||||
def test_en_redirect(self):
|
||||
response = self.client.get('/account/register', HTTP_ACCEPT_LANGUAGE='en', follow=True)
|
||||
# target status code of 301 because of CommonMiddleware redirecting
|
||||
self.assertIn(('/en/account/register/', 301), response.redirect_chain)
|
||||
# We only want one redirect, bypassing CommonMiddleware
|
||||
self.assertListEqual(response.redirect_chain, [('/en/account/register/', 302)])
|
||||
self.assertRedirects(response, '/en/account/register/', 302)
|
||||
|
||||
response = self.client.get('/prefixed.xml', HTTP_ACCEPT_LANGUAGE='en', follow=True)
|
||||
|
||||
Reference in New Issue
Block a user