diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-04-04 06:43:28 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-04-04 06:43:28 +0000 |
| commit | 5212911b1991aa749d828b31177dce99237068ed (patch) | |
| tree | ca681c3b3a68a29a75a6554f9d94caec003284be /tests | |
| parent | 1bddac37b69152d919a3af29f2844ae3e34c7237 (diff) | |
Made django.utils.html.escape() work with unicode strings (and unicode-like
objects). Refs #3897.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4919 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/defaultfilters/tests.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/regressiontests/defaultfilters/tests.py b/tests/regressiontests/defaultfilters/tests.py index db3f7fab2a..4a2e9432b0 100644 --- a/tests/regressiontests/defaultfilters/tests.py +++ b/tests/regressiontests/defaultfilters/tests.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + r""" >>> floatformat(7.7) '7.7' @@ -87,19 +89,19 @@ u'\xeb' >>> truncatewords('A sentence with a few words in it', 'not a number') 'A sentence with a few words in it' ->>> truncatewords_html('<p>one <a href="#">two - three <br>four</a> five</p>', 0) +>>> truncatewords_html('<p>one <a href="#">two - three <br>four</a> five</p>', 0) '' - ->>> truncatewords_html('<p>one <a href="#">two - three <br>four</a> five</p>', 2) + +>>> truncatewords_html('<p>one <a href="#">two - three <br>four</a> five</p>', 2) '<p>one <a href="#">two ...</a></p>' - ->>> truncatewords_html('<p>one <a href="#">two - three <br>four</a> five</p>', 4) + +>>> truncatewords_html('<p>one <a href="#">two - three <br>four</a> five</p>', 4) '<p>one <a href="#">two - three <br>four ...</a></p>' ->>> truncatewords_html('<p>one <a href="#">two - three <br>four</a> five</p>', 5) +>>> truncatewords_html('<p>one <a href="#">two - three <br>four</a> five</p>', 5) '<p>one <a href="#">two - three <br>four</a> five</p>' ->>> truncatewords_html('<p>one <a href="#">two - three <br>four</a> five</p>', 100) +>>> truncatewords_html('<p>one <a href="#">two - three <br>four</a> five</p>', 100) '<p>one <a href="#">two - three <br>four</a> five</p>' >>> upper('Mixed case input') @@ -166,6 +168,9 @@ u'\xcb' >>> escape('<some html & special characters > here') '<some html & special characters > here' +>>> escape(u'<some html & special characters > here ĐÅ€£') +u'<some html & special characters > here \xc4\x90\xc3\x85\xe2\x82\xac\xc2\xa3' + >>> linebreaks('line 1') '<p>line 1</p>' |
