Added a couple of extra tests to ensure url tag robustness. These are an

attempt to verify #8726.

Refs #8726.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8766 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2008-08-31 17:29:49 +00:00
parent ec525e3719
commit 6390155f5c
3 changed files with 6 additions and 0 deletions

View File

@ -891,6 +891,8 @@ class Templates(unittest.TestCase):
'url03': ('{% url regressiontests.templates.views.index %}', {}, '/url_tag/'), 'url03': ('{% url regressiontests.templates.views.index %}', {}, '/url_tag/'),
'url04': ('{% url named.client client.id %}', {'client': {'id': 1}}, '/url_tag/named-client/1/'), 'url04': ('{% url named.client client.id %}', {'client': {'id': 1}}, '/url_tag/named-client/1/'),
'url05': (u'{% url метка_оператора v %}', {'v': u'Ω'}, '/url_tag/%D0%AE%D0%BD%D0%B8%D0%BA%D0%BE%D0%B4/%CE%A9/'), 'url05': (u'{% url метка_оператора v %}', {'v': u'Ω'}, '/url_tag/%D0%AE%D0%BD%D0%B8%D0%BA%D0%BE%D0%B4/%CE%A9/'),
'url06': (u'{% url метка_оператора_2 tag=v %}', {'v': u'Ω'}, '/url_tag/%D0%AE%D0%BD%D0%B8%D0%BA%D0%BE%D0%B4/%CE%A9/'),
'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/'),
# Failures # Failures
'url-fail01': ('{% url %}', {}, template.TemplateSyntaxError), 'url-fail01': ('{% url %}', {}, template.TemplateSyntaxError),

View File

@ -12,4 +12,5 @@ urlpatterns = patterns('',
# Unicode strings are permitted everywhere. # Unicode strings are permitted everywhere.
url(ur'^Юникод/(\w+)/$', views.client, name=u"метка_оператора"), url(ur'^Юникод/(\w+)/$', views.client, name=u"метка_оператора"),
url(ur'^Юникод/(?P<tag>\S+)/$', 'regressiontests.templates.views.client2', name=u"метка_оператора_2"),
) )

View File

@ -8,3 +8,6 @@ def client(request, id):
def client_action(request, id, action): def client_action(request, id, action):
pass pass
def client2(request, tag):
pass