diff options
Diffstat (limited to 'tests/urlpatterns/tests.py')
| -rw-r--r-- | tests/urlpatterns/tests.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/urlpatterns/tests.py b/tests/urlpatterns/tests.py index f696cd531d..38b4392adc 100644 --- a/tests/urlpatterns/tests.py +++ b/tests/urlpatterns/tests.py @@ -116,6 +116,19 @@ class SimplifiedURLTests(SimpleTestCase): with self.assertRaisesMessage(ImproperlyConfigured, msg): path('foo/<nonexistent:var>/', empty_view) + def test_path_trailing_newlines(self): + tests = [ + '/articles/2003/\n', + '/articles/2010/\n', + '/en/foo/\n', + '/included_urls/extra/\n', + '/regex/1/\n', + '/users/1/\n', + ] + for url in tests: + with self.subTest(url=url), self.assertRaises(Resolver404): + resolve(url) + @override_settings(ROOT_URLCONF='urlpatterns.converter_urls') class ConverterTests(SimpleTestCase): |
