diff options
| author | Claude Paroz <claude@2xlibre.net> | 2016-01-06 18:33:29 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2016-01-06 20:34:45 +0100 |
| commit | 61437dd0a0a2592430ca912706524ffc0226f780 (patch) | |
| tree | 2b7fbbc8c932f207464ef2c4cf4a48dfb65ab669 /tests | |
| parent | 7688089e0fea41a1acf71a33de82fa1b63fa8be4 (diff) | |
[1.8.x] Fixed #26046 -- Fixed a crash with translations and Django-unknown language code
Thanks Jens Lundstrom for the report and Tim Graham for the review.
Backport of 632a9f21bc from master.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/i18n/tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/i18n/tests.py b/tests/i18n/tests.py index 9a20ba5d32..715057844f 100644 --- a/tests/i18n/tests.py +++ b/tests/i18n/tests.py @@ -1273,6 +1273,10 @@ class TestLanguageInfo(TestCase): def test_unknown_language_code(self): six.assertRaisesRegex(self, KeyError, r"Unknown language code xx\.", get_language_info, 'xx') + with translation.override('xx'): + # A language with no translation catalogs should fallback to the + # untranslated string. + self.assertEqual(ugettext("Title"), "Title") def test_unknown_only_country_code(self): li = get_language_info('de-xx') |
