Ticket #3543: url-tag-spaces.diff
File url-tag-spaces.diff, 2.9 KB (added by , 18 years ago) |
---|
-
django/template/defaulttags.py
925 925 for arg in bits[2].split(','): 926 926 if '=' in arg: 927 927 k, v = arg.split('=', 1) 928 if ' ' in k: 929 raise TemplateSyntaxError, "'%s' must not have spaces in keyword arguments" % bits[0] 928 930 kwargs[k] = parser.compile_filter(v) 929 931 else: 930 932 args.append(parser.compile_filter(arg)) -
tests/regressiontests/templates/views.py
8 8 9 9 def client_action(request, id, action): 10 10 pass 11 12 def client_location(request, country, city): 13 pass -
tests/regressiontests/templates/tests.py
651 651 'url01' : ('{% url regressiontests.templates.views.client client.id %}', {'client': {'id': 1}}, '/url_tag/client/1/'), 652 652 'url02' : ('{% url regressiontests.templates.views.client_action client.id,action="update" %}', {'client': {'id': 1}}, '/url_tag/client/1/update/'), 653 653 'url03' : ('{% url regressiontests.templates.views.index %}', {}, '/url_tag/'), 654 'url04' : ('{% url regressiontests.templates.views.client_location country="england",city="liverpool" %}', {}, '/url_tag/client/location/england/liverpool/'), 654 655 655 656 # Failures 656 'url04' : ('{% url %}', {}, template.TemplateSyntaxError), 657 'url05' : ('{% url no_such_view %}', {}, ''), 658 'url06' : ('{% url regressiontests.templates.views.client no_such_param="value" %}', {}, ''), 657 'url05' : ('{% url %}', {}, template.TemplateSyntaxError), 658 'url06' : ('{% url no_such_view %}', {}, ''), 659 'url07' : ('{% url regressiontests.templates.views.client no_such_param="value" %}', {}, ''), 660 'url08' : ('{% url regressiontests.templates.views.client_location country="england", city="liverpool" %}', {}, template.TemplateSyntaxError), 659 661 } 660 662 661 663 # Register our custom template loader. -
tests/regressiontests/templates/urls.py
7 7 (r'^$', views.index), 8 8 (r'^client/(\d+)/$', views.client), 9 9 (r'^client/(\d+)/(?P<action>[^/]+)/$', views.client_action), 10 (r'^client/location/(?P<country>[^/]+)/(?P<city>[^/]+)/$', views.client_location), 10 11 )