Added a checks test for valid i18n patterns.

This commit is contained in:
Tim Graham 2017-09-20 10:22:30 -04:00
parent a30ef353e2
commit 46dcdf9a29
2 changed files with 11 additions and 0 deletions

View File

@ -14,6 +14,10 @@ class CheckUrlConfigTests(SimpleTestCase):
result = check_url_config(None)
self.assertEqual(result, [])
@override_settings(ROOT_URLCONF='check_framework.urls.no_warnings_i18n')
def test_no_warnings_i18n(self):
self.assertEqual(check_url_config(None), [])
@override_settings(ROOT_URLCONF='check_framework.urls.warning_in_include')
def test_check_resolver_recursive(self):
# The resolver is checked recursively (examining url()s in include()).

View File

@ -0,0 +1,7 @@
from django.conf.urls import url
from django.conf.urls.i18n import i18n_patterns
from django.utils.translation import gettext_lazy as _
urlpatterns = i18n_patterns(
url(_('translated/'), lambda x: x, name='i18n_prefixed'),
)