summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2010-10-01 02:39:45 +0000
committerJannis Leidel <jannis@leidel.info>2010-10-01 02:39:45 +0000
commita0cabd766f9cbbf776e3a776a9eb41265502864d (patch)
tree7d8abdbdf20dea1784e1d14000fb348b0193929a /tests
parentebc084ca351a8d79a26f5239afc1b46a4d245139 (diff)
[1.2.X] Fixed #13568 -- Fixed the blocktrans tag to not raise a KeyError if the number of variables in the singular and the plural block differ. Thanks, deloide.
Backport from trunk (r13967). git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13973 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/templates/tests.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index bbbcae30eb..9e2d175677 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -1116,6 +1116,9 @@ class Templates(unittest.TestCase):
'i18n24': ("{% load i18n %}{% trans 'Page not found'|upper %}", {'LANGUAGE_CODE': 'de'}, u'SEITE NICHT GEFUNDEN'),
'i18n25': ('{% load i18n %}{% trans somevar|upper %}', {'somevar': 'Page not found', 'LANGUAGE_CODE': 'de'}, u'SEITE NICHT GEFUNDEN'),
+ # translation of plural form with extra field in singular form (#13568)
+ 'i18n26': ('{% load i18n %}{% blocktrans with myextra_field as extra_field count number as counter %}singular {{ extra_field }}{% plural %}plural{% endblocktrans %}', {'number': 1, 'myextra_field': 'test'}, "singular test"),
+
### HANDLING OF TEMPLATE_STRING_IF_INVALID ###################################
'invalidstr01': ('{{ var|default:"Foo" }}', {}, ('Foo','INVALID')),