summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-05-24 06:44:54 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-05-24 06:44:54 +0000
commita09cb2a9e57b7a8239a3197601427ec89f207910 (patch)
tree6393ec1346124924452cddd1fe11ef7887670529 /tests
parent31d5d550901d2fe30679bb2ef6302af2c3df1372 (diff)
unicode: Added unicode-aware equivalents of urllib.quote() and
urllib.quote_plus() in django.utils.html. git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5328 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/text/tests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/regressiontests/text/tests.py b/tests/regressiontests/text/tests.py
index c57ac54078..8cc8e4eeac 100644
--- a/tests/regressiontests/text/tests.py
+++ b/tests/regressiontests/text/tests.py
@@ -16,10 +16,19 @@ r"""
>>> print list(smart_split(r'''all friends' tests'''))[1]
friends'
+### urlquote #############################################################
+>>> from django.utils.html import urlquote, urlquote_plus
+>>> urlquote(u'Paris & Orl\xe9ans')
+u'Paris%20%26%20Orl%C3%A9ans'
+>>> urlquote_plus(u'Paris & Orl\xe9ans')
+u'Paris+%26+Orl%C3%A9ans'
+
### iri_to_uri ###########################################################
>>> from django.utils.encoding import iri_to_uri
>>> iri_to_uri(u'red%09ros\xe9#red')
'red%09ros%C3%A9#red'
>>> iri_to_uri(u'/blog/for/J\xfcrgen M\xfcnster/')
'/blog/for/J%C3%BCrgen%20M%C3%BCnster/'
+>>> iri_to_uri(u'locations/%s' % urlquote_plus(u'Paris & Orl\xe9ans'))
+'locations/Paris+%26+Orl%C3%A9ans'
"""