summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2011-03-02 21:36:41 +0000
committerJannis Leidel <jannis@leidel.info>2011-03-02 21:36:41 +0000
commit93cd8442fc6a1b4838ccc6609b6771d697958c05 (patch)
treebee9fc5cd891f8d263b89fc9a05765f3cfc5f989 /tests
parentcff4ee5cbacd4353015f528610a346f9b9f5bda8 (diff)
Fixed #15535 -- Stopped the blocktrans template tag from raising a KeyError if an included variable can't be found in the context. Thanks, melinath.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15709 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 54c97ce117..fb47b27d90 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -1245,6 +1245,9 @@ class Templates(unittest.TestCase):
'i18n32': ('{% load i18n %}{{ "hu"|language_name }} {{ "hu"|language_name_local }} {{ "hu"|language_bidi }}', {}, u'Hungarian Magyar False'),
'i18n33': ('{% load i18n %}{{ langcode|language_name }} {{ langcode|language_name_local }} {{ langcode|language_bidi }}', {'langcode': 'nl'}, u'Dutch Nederlands False'),
+ # blocktrans handling of variables which are not in the context.
+ 'i18n34': ('{% load i18n %}{% blocktrans %}{{ missing }}{% endblocktrans %}', {}, u''),
+
### HANDLING OF TEMPLATE_STRING_IF_INVALID ###################################
'invalidstr01': ('{{ var|default:"Foo" }}', {}, ('Foo','INVALID')),