summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2017-05-20 13:28:20 +0200
committerClaude Paroz <claude@2xlibre.net>2017-05-25 22:47:21 +0200
commit2cbb095bec757b804e8b6d9d0930ef3c6446a591 (patch)
tree281135225f41570ad4611d5c73242ddefedb6122 /tests
parented9bc4e576d57863c10d839ee43fb2febf04fb84 (diff)
Fixed #28221 -- Fixed plural fallback translations in JavaScriptCatalog view
Thanks Waldemar Kornewald for the report and initial patch.
Diffstat (limited to 'tests')
-rw-r--r--tests/view_tests/tests/test_i18n.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/view_tests/tests/test_i18n.py b/tests/view_tests/tests/test_i18n.py
index 2c12177a59..8cd6376507 100644
--- a/tests/view_tests/tests/test_i18n.py
+++ b/tests/view_tests/tests/test_i18n.py
@@ -272,13 +272,27 @@ class I18NViewTests(SimpleTestCase):
def test_i18n_fallback_language_plural(self):
"""
The fallback to a language with less plural forms maintains the real
- language's number of plural forms.
+ language's number of plural forms and correct translations.
"""
with self.settings(LANGUAGE_CODE='pt'), override('ru'):
response = self.client.get('/jsi18n/')
self.assertEqual(
response.context['catalog']['{count} plural3'],
- ['{count} plural3', '{count} plural3s', '{count} plural3 p3t']
+ ['{count} plural3 p3', '{count} plural3 p3s', '{count} plural3 p3t']
+ )
+ self.assertEqual(
+ response.context['catalog']['{count} plural2'],
+ ['{count} plural2', '{count} plural2s', '']
+ )
+ with self.settings(LANGUAGE_CODE='ru'), override('pt'):
+ response = self.client.get('/jsi18n/')
+ self.assertEqual(
+ response.context['catalog']['{count} plural3'],
+ ['{count} plural3', '{count} plural3s']
+ )
+ self.assertEqual(
+ response.context['catalog']['{count} plural2'],
+ ['{count} plural2', '{count} plural2s']
)
def test_i18n_english_variant(self):