diff --git a/tests/i18n/test_28556.py b/tests/i18n/test_28556.py
new file mode 100644
index 0000000..e3827ce
-
|
+
|
|
| 1 | from django.test import SimpleTestCase, override_settings |
| 2 | from django.urls import resolve |
| 3 | |
| 4 | @override_settings( |
| 5 | USE_I18N=True, |
| 6 | LANGUAGES=[ |
| 7 | ('en', 'English'), |
| 8 | ('de', 'German'), |
| 9 | ('fr', 'French'), |
| 10 | ], |
| 11 | MIDDLEWARE=[ |
| 12 | 'django.middleware.locale.LocaleMiddleware', |
| 13 | 'django.middleware.common.CommonMiddleware', |
| 14 | ], |
| 15 | ROOT_URLCONF='i18n.urls_unprefixed', |
| 16 | LANGUAGE_CODE='en', |
| 17 | ) |
| 18 | class UnprefixedDefaultLanguageTests2(SimpleTestCase): |
| 19 | |
| 20 | def test_resolve(self): |
| 21 | self.assertEqual(resolve('/').view_name, 'i18n.urls_unprefixed.empty_view') |
diff --git a/tests/i18n/urls_unprefixed.py b/tests/i18n/urls_unprefixed.py
new file mode 100644
index 0000000..98228b8
-
|
+
|
|
| 1 | from django.conf.urls import url |
| 2 | from django.conf.urls.i18n import i18n_patterns |
| 3 | from django.http import HttpResponse |
| 4 | |
| 5 | def empty_view(request): |
| 6 | return HttpResponse() |
| 7 | |
| 8 | urlpatterns = i18n_patterns( |
| 9 | url(r'', empty_view), |
| 10 | prefix_default_language=False, |
| 11 | ) |