summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMaxim Piskunov <felreaverbrah@gmail.com>2021-11-18 00:25:51 +0300
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-12-03 12:57:06 +0100
commitd3f4c2b95d2a13a5d9bc0e6413dfdbab21388822 (patch)
treebfeffaf5d1787fff48fed221b0bc94222f9bc0f7 /tests
parent4f7bbc61386ec89bf664905609ae6e93e41bd6bf (diff)
Fixed #33078 -- Added support for language regions in i18n_patterns().
Diffstat (limited to 'tests')
-rw-r--r--tests/i18n/tests.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/i18n/tests.py b/tests/i18n/tests.py
index dfceaa5381..0b419d426c 100644
--- a/tests/i18n/tests.py
+++ b/tests/i18n/tests.py
@@ -1593,11 +1593,15 @@ class MiscTests(SimpleTestCase):
@override_settings(
LANGUAGES=[
('en', 'English'),
+ ('en-latn-us', 'Latin English'),
+ ('en-Latn-US', 'BCP 47 case format'),
('de', 'German'),
('de-1996', 'German, orthography of 1996'),
('de-at', 'Austrian German'),
+ ('de-ch-1901', 'German, Swiss variant, traditional orthography'),
('i-mingo', 'Mingo'),
('kl-tunumiit', 'Tunumiisiut'),
+ ('nan-hani-tw', 'Hanji'),
('pl', 'Polish'),
],
)
@@ -1609,13 +1613,17 @@ class MiscTests(SimpleTestCase):
('/xyz/', None),
('/en/', 'en'),
('/en-gb/', 'en'),
+ ('/en-latn-us/', 'en-latn-us'),
+ ('/en-Latn-US/', 'en-Latn-US'),
('/de/', 'de'),
('/de-1996/', 'de-1996'),
('/de-at/', 'de-at'),
('/de-ch/', 'de'),
- ('/de-simple-page/', None),
+ ('/de-ch-1901/', 'de-ch-1901'),
+ ('/de-simple-page-test/', None),
('/i-mingo/', 'i-mingo'),
('/kl-tunumiit/', 'kl-tunumiit'),
+ ('/nan-hani-tw/', 'nan-hani-tw'),
]
for path, language in tests:
with self.subTest(path=path):
@@ -1824,7 +1832,7 @@ class UnprefixedDefaultLanguageTests(SimpleTestCase):
def test_page_with_dash(self):
# A page starting with /de* shouldn't match the 'de' language code.
- response = self.client.get('/de-simple-page/')
+ response = self.client.get('/de-simple-page-test/')
self.assertEqual(response.content, b'Yes')
def test_no_redirect_on_404(self):