summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-04-10 04:13:27 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-04-10 04:13:27 +0000
commitbe4a83c4483501102afbfd786100e46ed06cc05c (patch)
treee20c7f00c272e4ee29c26edadb6d91daee097725 /tests
parentf6309cbf8058b77729f9ba96c26accdbb7ae5596 (diff)
Fixed #9315 -- Handle spaces in URL tag arguments.
Thanks Natalia Bidart and Matías Bordese for most of this patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10462 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 91c6d22b33..5176b116e9 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -974,6 +974,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 75c360f344..09b8c30398 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