Commit e71b63e2 authored by Ramiro Morales's avatar Ramiro Morales
Browse files

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

parent 687afdaa
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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'):
+1 −0
Original line number Diff line number Diff line
@@ -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'),
)
+9 −0
Original line number Diff line number Diff line
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'),
)