1
0
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:
Claude Paroz
2013-01-11 21:27:51 +01:00
parent f08e739bc2
commit bcdb4898ca
3 changed files with 10 additions and 3 deletions

View File

@@ -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):
"""