diff --git a/tests/i18n/patterns/tests.py b/tests/i18n/patterns/tests.py index d334e4fe2d..85eb7db084 100644 --- a/tests/i18n/patterns/tests.py +++ b/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 @@ 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/') diff --git a/tests/i18n/patterns/urls/default.py b/tests/i18n/patterns/urls/default.py index 0edaea48ad..ff52e26227 100644 --- a/tests/i18n/patterns/urls/default.py +++ b/tests/i18n/patterns/urls/default.py @@ -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[\w-]+)/$'), view, name='no-prefix-translated-slug'), ) diff --git a/tests/i18n/patterns/urls/included.py b/tests/i18n/patterns/urls/included.py new file mode 100644 index 0000000000..3f3d1325dd --- /dev/null +++ b/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'), +)