mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
Fixed #19488 -- Made i18n_patterns redirect work with non-slash-ending paths
Thanks Daniel Gerzo for the report and the initial patch.
This commit is contained in:
@@ -115,6 +115,7 @@ class URLTranslationTests(URLTestCaseBase):
|
||||
|
||||
with translation.override('nl'):
|
||||
self.assertEqual(reverse('users'), '/nl/gebruikers/')
|
||||
self.assertEqual(reverse('prefixed_xml'), '/nl/prefixed.xml')
|
||||
|
||||
with translation.override('pt-br'):
|
||||
self.assertEqual(reverse('users'), '/pt-br/usuarios/')
|
||||
@@ -186,6 +187,9 @@ class URLRedirectWithoutTrailingSlashTests(URLTestCaseBase):
|
||||
self.assertIn(('http://testserver/en/account/register/', 301), response.redirect_chain)
|
||||
self.assertRedirects(response, '/en/account/register/', 302)
|
||||
|
||||
response = self.client.get('/prefixed.xml', HTTP_ACCEPT_LANGUAGE='en', follow=True)
|
||||
self.assertRedirects(response, '/en/prefixed.xml', 302)
|
||||
|
||||
|
||||
class URLRedirectWithoutTrailingSlashSettingTests(URLTestCaseBase):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user