summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2016-01-06 18:33:29 +0100
committerClaude Paroz <claude@2xlibre.net>2016-01-06 20:33:26 +0100
commitfe6d5689f291c7c56f280203f9c9bbbdde87044a (patch)
tree63fdc8d0dd85a6572dcd1500a3acc6cd715f0792 /tests
parenta7b69c8657609c925da055553f289760a66c64cf (diff)
[1.9.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.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/i18n/tests.py b/tests/i18n/tests.py
index 8e545c9e43..667451119d 100644
--- a/tests/i18n/tests.py
+++ b/tests/i18n/tests.py
@@ -1577,6 +1577,10 @@ class TestLanguageInfo(SimpleTestCase):
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')