diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-04-11 12:07:52 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-04-11 12:07:52 +0000 |
| commit | 13475ed646ec47d779e416efb8349393c12bcf3f (patch) | |
| tree | 44dfd12824a776a6fcb286d2a3e51ceeeb0c4d8d /tests | |
| parent | f943e2e4181b6570d4d6f85b0e2dff311ae20597 (diff) | |
[1.0.X] Fixed #10369 -- Fixed auto-escaping inside "tran" and "blocktrans" tags.
Patch from Andrew Badr.
Backport of r10519 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10520 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/templates/tests.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py index 51ad9c574c..0f52618c76 100644 --- a/tests/regressiontests/templates/tests.py +++ b/tests/regressiontests/templates/tests.py @@ -825,12 +825,16 @@ class Templates(unittest.TestCase): 'i18n14': ('{% cycle "foo" _("Password") _(\'Password\') as c %} {% cycle c %} {% cycle c %}', {'LANGUAGE_CODE': 'de'}, 'foo Passwort Passwort'), 'i18n15': ('{{ absent|default:_("Password") }}', {'LANGUAGE_CODE': 'de', 'absent': ""}, 'Passwort'), 'i18n16': ('{{ _("<") }}', {'LANGUAGE_CODE': 'de'}, '<'), - 'i18n17': ('{{ _("") }}', {'LANGUAGE_CODE': 'de'}, ''), + 'i18n16a': ('{{ _("") }}', {'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. - 'i18n18': ('{% load i18n %}{% blocktrans with anton|escape as berta %}{{ berta }}{% endblocktrans %}', {'anton': 'α & β'}, u'α & β'), - 'i18n19': ('{% load i18n %}{% blocktrans with anton|force_escape as berta %}{{ berta }}{% endblocktrans %}', {'anton': 'α & β'}, u'α & β'), + 'i18n17': ('{% load i18n %}{% blocktrans with anton|escape as berta %}{{ berta }}{% endblocktrans %}', {'anton': 'α & β'}, u'α & β'), + 'i18n18': ('{% load i18n %}{% blocktrans with anton|force_escape as berta %}{{ berta }}{% endblocktrans %}', {'anton': 'α & β'}, u'α & β'), + 'i18n19': ('{% load i18n %}{% blocktrans %}{{ andrew }}{% endblocktrans %}', {'andrew': 'a & b'}, u'a & b'), + 'i18n20': ('{% load i18n %}{% trans andrew %}', {'andrew': 'a & b'}, u'a & 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 ################################### |
