Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.2.X] Fixed #15041 -- Added tests for the spaceless tag interacting…

… with escaping. Thanks to steveire.

Backport of r15334 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15337 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit ee29ec62be475e9719785917758e059b9bca124b 1 parent 10b4d93
Russell Keith-Magee authored January 27, 2011

Showing 1 changed file with 3 additions and 0 deletions. Show diff stats Hide diff stats

  1. 3  tests/regressiontests/templates/tests.py
3  tests/regressiontests/templates/tests.py
@@ -1049,6 +1049,9 @@ def get_template_tests(self):
1049 1049
             'spaceless01': ("{% spaceless %} <b>    <i> text </i>    </b> {% endspaceless %}", {}, "<b><i> text </i></b>"),
1050 1050
             'spaceless02': ("{% spaceless %} <b> \n <i> text </i> \n </b> {% endspaceless %}", {}, "<b><i> text </i></b>"),
1051 1051
             'spaceless03': ("{% spaceless %}<b><i>text</i></b>{% endspaceless %}", {}, "<b><i>text</i></b>"),
  1052
+            'spaceless04': ("{% spaceless %}<b>   <i>{{ text }}</i>  </b>{% endspaceless %}", {'text' : 'This & that'}, "<b><i>This &amp; that</i></b>"),
  1053
+            'spaceless05': ("{% autoescape off %}{% spaceless %}<b>   <i>{{ text }}</i>  </b>{% endspaceless %}{% endautoescape %}", {'text' : 'This & that'}, "<b><i>This & that</i></b>"),
  1054
+            'spaceless06': ("{% spaceless %}<b>   <i>{{ text|safe }}</i>  </b>{% endspaceless %}", {'text' : 'This & that'}, "<b><i>This & that</i></b>"),
1052 1055
 
1053 1056
             # simple translation of a string delimited by '
1054 1057
             'i18n01': ("{% load i18n %}{% trans 'xxxyyyxxx' %}", {}, "xxxyyyxxx"),

0 notes on commit ee29ec6

Please sign in to comment.
Something went wrong with that request. Please try again.