mirror of https://github.com/django/django.git
Added a checks test for valid i18n patterns.
This commit is contained in:
parent
a30ef353e2
commit
46dcdf9a29
|
@ -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()).
|
||||
|
|
|
@ -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'),
|
||||
)
|
Loading…
Reference in New Issue