Ticket #5994: test-url-tag-fails-on-dots.patch

File test-url-tag-fails-on-dots.patch, 1.7 KB (added by Adam Vandenberg, 17 years ago)

Test to demonstrate the problem.

  • regressiontests/templates/tests.py

     
    856856            'url04' : ('{% url named.client client.id %}', {'client': {'id': 1}}, '/url_tag/named-client/1/'),
    857857            'url05' : (u'{% url метка_оператора v %}', {'v': u'Ω'},
    858858                    '/url_tag/%D0%AE%D0%BD%D0%B8%D0%BA%D0%BE%D0%B4/%CE%A9/'),
     859            'url06' : ('{% url dotted-url client.id1,client.id2 %}', {'client': {'id1': 1, 'id2': 2}}, '/url_tag/client/1.2/'),
    859860
    860861            # Failures
    861862            'url-fail01' : ('{% url %}', {}, template.TemplateSyntaxError),
  • regressiontests/templates/urls.py

     
    99    (r'^client/(\d+)/$', views.client),
    1010    (r'^client/(?P<id>\d+)/(?P<action>[^/]+)/$', views.client_action),
    1111    url(r'^named-client/(\d+)/$', views.client, name="named.client"),
     12   
     13    # Url with a dot
     14    url(r'^client/(?P<id1>\d+)\.(?P<id2>\d+)/$', views.dotted, name="dotted-url"),
    1215
    1316    # Unicode strings are permitted everywhere.
    1417    url(ur'^Юникод/(\w+)/$', views.client, name=u"метка_оператора"),
  • regressiontests/templates/views.py

     
    88
    99def client_action(request, id, action):
    1010    pass
     11   
     12def dotted(request, id1, id2):
     13    pass
Back to Top