Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #15041 -- Added tests for the spaceless tag interacting with es…

…caping. Thanks to steveire.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15334 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 701204254478a03fd95a2508be7f1f47bcebae43 1 parent 7c0e405
@freakboy3742 freakboy3742 authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  tests/regressiontests/templates/tests.py
View
3  tests/regressiontests/templates/tests.py
@@ -1136,6 +1136,9 @@ def get_template_tests(self):
'spaceless01': ("{% spaceless %} <b> <i> text </i> </b> {% endspaceless %}", {}, "<b><i> text </i></b>"),
'spaceless02': ("{% spaceless %} <b> \n <i> text </i> \n </b> {% endspaceless %}", {}, "<b><i> text </i></b>"),
'spaceless03': ("{% spaceless %}<b><i>text</i></b>{% endspaceless %}", {}, "<b><i>text</i></b>"),
+ 'spaceless04': ("{% spaceless %}<b> <i>{{ text }}</i> </b>{% endspaceless %}", {'text' : 'This & that'}, "<b><i>This &amp; that</i></b>"),
+ 'spaceless05': ("{% autoescape off %}{% spaceless %}<b> <i>{{ text }}</i> </b>{% endspaceless %}{% endautoescape %}", {'text' : 'This & that'}, "<b><i>This & that</i></b>"),
+ 'spaceless06': ("{% spaceless %}<b> <i>{{ text|safe }}</i> </b>{% endspaceless %}", {'text' : 'This & that'}, "<b><i>This & that</i></b>"),
# simple translation of a string delimited by '
'i18n01': ("{% load i18n %}{% trans 'xxxyyyxxx' %}", {}, "xxxyyyxxx"),
Please sign in to comment.
Something went wrong with that request. Please try again.