mirror of https://github.com/django/django.git
Added i18n-related URL mapper test for a mailing list report.
This commit is contained in:
parent
687afdaa48
commit
e71b63e280
|
@ -52,8 +52,10 @@ class URLPrefixTests(URLTestCaseBase):
|
|||
def test_not_prefixed(self):
|
||||
with translation.override('en'):
|
||||
self.assertEqual(reverse('not-prefixed'), '/not-prefixed/')
|
||||
self.assertEqual(reverse('not-prefixed-included-url'), '/not-prefixed-include/foo/')
|
||||
with translation.override('nl'):
|
||||
self.assertEqual(reverse('not-prefixed'), '/not-prefixed/')
|
||||
self.assertEqual(reverse('not-prefixed-included-url'), '/not-prefixed-include/foo/')
|
||||
|
||||
def test_prefixed(self):
|
||||
with translation.override('en'):
|
||||
|
@ -183,7 +185,7 @@ class URLRedirectTests(URLTestCaseBase):
|
|||
class URLVaryAcceptLanguageTests(URLTestCaseBase):
|
||||
"""
|
||||
Tests that 'Accept-Language' is not added to the Vary header when using
|
||||
prefixed URLs.
|
||||
prefixed URLs.
|
||||
"""
|
||||
def test_no_prefix_response(self):
|
||||
response = self.client.get('/not-prefixed/')
|
||||
|
|
|
@ -8,6 +8,7 @@ view = TemplateView.as_view(template_name='dummy.html')
|
|||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^not-prefixed/$', view, name='not-prefixed'),
|
||||
url(r'^not-prefixed-include/', include('i18n.patterns.urls.included')),
|
||||
url(_(r'^translated/$'), view, name='no-prefix-translated'),
|
||||
url(_(r'^translated/(?P<slug>[\w-]+)/$'), view, name='no-prefix-translated-slug'),
|
||||
)
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
from django.conf.urls import patterns, url
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
|
||||
view = TemplateView.as_view(template_name='dummy.html')
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^foo/$', view, name='not-prefixed-included-url'),
|
||||
)
|
Loading…
Reference in New Issue