summaryrefslogtreecommitdiff
path: root/tests/regressiontests/templates
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-04-11 12:03:52 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-04-11 12:03:52 +0000
commitb1a5db37e6631ab4a964d7f8d52dfe593f9e6c4b (patch)
tree3ce24d81abffe8ec5ca053f22f7849566cffe866 /tests/regressiontests/templates
parentd18f75af447bc18b062564ab163943c16d79effc (diff)
Fixed #10369 -- Fixed auto-escaping inside "tran" and "blocktrans" tags.
Patch from Andrew Badr. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10519 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/templates')
-rw-r--r--tests/regressiontests/templates/tests.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index 5176b116e9..953e8faa1a 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -851,10 +851,14 @@ class Templates(unittest.TestCase):
'i18n15': ('{{ absent|default:_("Password") }}', {'LANGUAGE_CODE': 'de', 'absent': ""}, 'Passwort'),
'i18n16': ('{{ _("<") }}', {'LANGUAGE_CODE': 'de'}, '<'),
- # Escaping inside blocktrans works as if it was directly in the
+ # Escaping inside blocktrans and trans works as if it was directly in the
# template.
'i18n17': ('{% load i18n %}{% blocktrans with anton|escape as berta %}{{ berta }}{% endblocktrans %}', {'anton': 'α & β'}, u'α &amp; β'),
'i18n18': ('{% load i18n %}{% blocktrans with anton|force_escape as berta %}{{ berta }}{% endblocktrans %}', {'anton': 'α & β'}, u'α &amp; β'),
+ 'i18n19': ('{% load i18n %}{% blocktrans %}{{ andrew }}{% endblocktrans %}', {'andrew': 'a & b'}, u'a &amp; b'),
+ 'i18n20': ('{% load i18n %}{% trans andrew %}', {'andrew': 'a & b'}, u'a &amp; b'),
+ 'i18n21': ('{% load i18n %}{% blocktrans %}{{ andrew }}{% endblocktrans %}', {'andrew': mark_safe('a & b')}, u'a & b'),
+ 'i18n22': ('{% load i18n %}{% trans andrew %}', {'andrew': mark_safe('a & b')}, u'a & b'),
### HANDLING OF TEMPLATE_STRING_IF_INVALID ###################################