diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py index d997d20077..2deae6d403 100644 --- a/django/template/defaulttags.py +++ b/django/template/defaulttags.py @@ -956,6 +956,7 @@ def url(parser, token): for arg in bits[2].split(','): if '=' in arg: k, v = arg.split('=', 1) + k = k.strip() kwargs[k] = parser.compile_filter(v) else: args.append(parser.compile_filter(arg)) diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py index 93fb1ecb4d..f996f63049 100644 --- a/tests/regressiontests/templates/tests.py +++ b/tests/regressiontests/templates/tests.py @@ -694,7 +694,7 @@ class Templates(unittest.TestCase): ### URL TAG ######################################################## # Successes 'url01' : ('{% url regressiontests.templates.views.client client.id %}', {'client': {'id': 1}}, '/url_tag/client/1/'), - 'url02' : ('{% url regressiontests.templates.views.client_action client.id,action="update" %}', {'client': {'id': 1}}, '/url_tag/client/1/update/'), + 'url02' : ('{% url regressiontests.templates.views.client_action client.id, action="update" %}', {'client': {'id': 1}}, '/url_tag/client/1/update/'), 'url03' : ('{% url regressiontests.templates.views.index %}', {}, '/url_tag/'), 'url04' : ('{% url named-client client.id %}', {'client': {'id': 1}}, '/url_tag/named-client/1/'),