summaryrefslogtreecommitdiff
path: root/tests/check_framework
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-09-20 10:22:30 -0400
committerTim Graham <timograham@gmail.com>2017-09-20 10:23:28 -0400
commit46dcdf9a29ddc5b687bcf0491e013548a6f44281 (patch)
tree890f3192488f0e9f17c35b37c28143ee673c8234 /tests/check_framework
parenta30ef353e2a28c47eb1b548d02a2dab7d4b632ff (diff)
Added a checks test for valid i18n patterns.
Diffstat (limited to 'tests/check_framework')
-rw-r--r--tests/check_framework/test_urls.py4
-rw-r--r--tests/check_framework/urls/no_warnings_i18n.py7
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/check_framework/test_urls.py b/tests/check_framework/test_urls.py
index b60578cbdb..07acab599b 100644
--- a/tests/check_framework/test_urls.py
+++ b/tests/check_framework/test_urls.py
@@ -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()).
diff --git a/tests/check_framework/urls/no_warnings_i18n.py b/tests/check_framework/urls/no_warnings_i18n.py
new file mode 100644
index 0000000000..7c494c7dc9
--- /dev/null
+++ b/tests/check_framework/urls/no_warnings_i18n.py
@@ -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'),
+)