summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-04-10 04:49:00 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-04-10 04:49:00 +0000
commitdd7198701a38519f1844376873d783aee5b094d6 (patch)
tree75415198986c8245c68bc958258d39b0b2e546c5 /tests
parent6c45765681b71e91633d4447eeb4088c4989dde5 (diff)
[1.0.X] Fixed #9315 -- Handle spaces in URL tag arguments.
Thanks Natalia Bidart and Matías Bordese for most of this patch. Backport of r10462 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10463 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/templates/tests.py1
-rw-r--r--tests/regressiontests/text/tests.py12
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index aecf94d461..51ad9c574c 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -947,6 +947,7 @@ class Templates(unittest.TestCase):
'url07': (u'{% url regressiontests.templates.views.client2 tag=v %}', {'v': u'Ω'}, '/url_tag/%D0%AE%D0%BD%D0%B8%D0%BA%D0%BE%D0%B4/%CE%A9/'),
'url08': (u'{% url метка_оператора v %}', {'v': 'Ω'}, '/url_tag/%D0%AE%D0%BD%D0%B8%D0%BA%D0%BE%D0%B4/%CE%A9/'),
'url09': (u'{% url метка_оператора_2 tag=v %}', {'v': 'Ω'}, '/url_tag/%D0%AE%D0%BD%D0%B8%D0%BA%D0%BE%D0%B4/%CE%A9/'),
+ 'url10': ('{% url regressiontests.templates.views.client_action id=client.id,action="two words" %}', {'client': {'id': 1}}, '/url_tag/client/1/two%20words/'),
# Failures
'url-fail01': ('{% url %}', {}, template.TemplateSyntaxError),
diff --git a/tests/regressiontests/text/tests.py b/tests/regressiontests/text/tests.py
index 7cfe44517a..d1db80dc34 100644
--- a/tests/regressiontests/text/tests.py
+++ b/tests/regressiontests/text/tests.py
@@ -15,6 +15,18 @@ r"""
[u'"a', u"'one"]
>>> print list(smart_split(r'''all friends' tests'''))[1]
friends'
+>>> list(smart_split(u'url search_page words="something else"'))
+[u'url', u'search_page', u'words="something else"']
+>>> list(smart_split(u"url search_page words='something else'"))
+[u'url', u'search_page', u"words='something else'"]
+>>> list(smart_split(u'url search_page words "something else"'))
+[u'url', u'search_page', u'words', u'"something else"']
+>>> list(smart_split(u'url search_page words-"something else"'))
+[u'url', u'search_page', u'words-"something else"']
+>>> list(smart_split(u'url search_page words=hello'))
+[u'url', u'search_page', u'words=hello']
+>>> list(smart_split(u'url search_page words="something else'))
+[u'url', u'search_page', u'words="something', u'else']
### urlquote #############################################################
>>> from django.utils.http import urlquote, urlquote_plus