зеркало из https://github.com/mozilla/kitsune.git
Ensure that /en redirects to /en-US instead of /en-us.
This commit is contained in:
Родитель
c509571308
Коммит
c9e043a690
|
@ -29,3 +29,8 @@ class TestLocaleMiddleware(TestCase):
|
|||
"""Requests for /fr-FR/search should end up on /fr/search"""
|
||||
reponse = self.client.get('/fr-FR/search', follow=True)
|
||||
self.assertRedirects(reponse, '/fr/search', status_code=301)
|
||||
|
||||
def test_partial_redirect(self):
|
||||
"""Ensure that /en/ gets directed to /en-US/."""
|
||||
response = self.client.get('/en/search', follow=True)
|
||||
self.assertRedirects(response, '/en-US/search', status_code=301)
|
||||
|
|
|
@ -32,7 +32,8 @@ def reverse(viewname, urlconf=None, args=None, kwargs=None, prefix=None):
|
|||
|
||||
|
||||
def find_supported(test):
|
||||
return [x for x in settings.LANGUAGE_URL_MAP if
|
||||
return [settings.LANGUAGE_URL_MAP[x] for
|
||||
x in settings.LANGUAGE_URL_MAP if
|
||||
x.split('-', 1)[0] == test.lower().split('-', 1)[0]]
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче