Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added i18n-related URL mapper test for a mailing list report.

  • Loading branch information...
commit e71b63e280559122371d125d75a593dc2435c394 1 parent 687afda
@ramiro ramiro authored
View
4 tests/i18n/patterns/tests.py
@@ -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 @@ def test_pl_pl_redirect(self):
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/')
View
1  tests/i18n/patterns/urls/default.py
@@ -8,6 +8,7 @@
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'),
)
View
9 tests/i18n/patterns/urls/included.py
@@ -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'),
+)
Please sign in to comment.
Something went wrong with that request. Please try again.