summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/i18n/patterns/tests.py10
-rw-r--r--tests/regressiontests/i18n/tests.py4
2 files changed, 11 insertions, 3 deletions
diff --git a/tests/regressiontests/i18n/patterns/tests.py b/tests/regressiontests/i18n/patterns/tests.py
index 0a785ab1d6..3f77136efb 100644
--- a/tests/regressiontests/i18n/patterns/tests.py
+++ b/tests/regressiontests/i18n/patterns/tests.py
@@ -19,7 +19,7 @@ from django.utils import translation
TEMPLATE_DIRS=(
os.path.join(os.path.dirname(upath(__file__)), 'templates'),
),
- LANGUAGE_CODE='en',
+ LANGUAGE_CODE='en-us',
LANGUAGES=(
('nl', 'Dutch'),
('en', 'English'),
@@ -171,6 +171,14 @@ class URLRedirectTests(URLTestCaseBase):
response = self.client.get(response['location'])
self.assertEqual(response.status_code, 200)
+ def test_pl_pl_redirect(self):
+ # language from outside of the supported LANGUAGES list
+ response = self.client.get('/account/register/', HTTP_ACCEPT_LANGUAGE='pl-pl')
+ self.assertRedirects(response, '/en/account/register/')
+
+ response = self.client.get(response['location'])
+ self.assertEqual(response.status_code, 200)
+
class URLVaryAcceptLanguageTests(URLTestCaseBase):
"""
diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py
index aaa9b12c3b..520469ca79 100644
--- a/tests/regressiontests/i18n/tests.py
+++ b/tests/regressiontests/i18n/tests.py
@@ -958,7 +958,7 @@ class TestLanguageInfo(TestCase):
self.assertEqual(li['bidi'], False)
def test_unknown_language_code(self):
- six.assertRaisesRegex(self, KeyError, "Unknown language code '?xx'?.", get_language_info, 'xx-xx')
+ six.assertRaisesRegex(self, KeyError, r"Unknown language code xx\.", get_language_info, 'xx')
def test_unknown_only_country_code(self):
li = get_language_info('de-xx')
@@ -968,7 +968,7 @@ class TestLanguageInfo(TestCase):
self.assertEqual(li['bidi'], False)
def test_unknown_language_code_and_country_code(self):
- six.assertRaisesRegex(self, KeyError, "Unknown language code '?xx-xx'? and '?xx'?.", get_language_info, 'xx-xx')
+ six.assertRaisesRegex(self, KeyError, r"Unknown language code xx-xx and xx\.", get_language_info, 'xx-xx')
class MultipleLocaleActivationTests(TestCase):