mirror of
https://github.com/django/django.git
synced 2025-10-30 00:56:09 +00:00
Fixed #17720 -- Stopped the LocaleMiddleware from overeagerly using the request path for language activation if it's actually not wanted. Thanks to Anssi Kääriäinen for the initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17547 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -78,6 +78,20 @@ class URLDisabledTests(URLTestCaseBase):
|
||||
self.assertEqual(reverse('prefixed'), '/prefixed/')
|
||||
|
||||
|
||||
class PathUnusedTests(URLTestCaseBase):
|
||||
"""
|
||||
Check that if no i18n_patterns is used in root urlconfs, then no
|
||||
language activation happens based on url prefix.
|
||||
"""
|
||||
urls = 'regressiontests.i18n.patterns.urls.path_unused'
|
||||
|
||||
def test_no_lang_activate(self):
|
||||
response = self.client.get('/nl/foo/')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(response['content-language'], 'en')
|
||||
self.assertEqual(response.context['LANGUAGE_CODE'], 'en')
|
||||
|
||||
|
||||
class URLTranslationTests(URLTestCaseBase):
|
||||
"""
|
||||
Tests if the pattern-strings are translated correctly (within the
|
||||
|
||||
Reference in New Issue
Block a user