summaryrefslogtreecommitdiff
path: root/tests/urlpatterns/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/urlpatterns/tests.py')
-rw-r--r--tests/urlpatterns/tests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/urlpatterns/tests.py b/tests/urlpatterns/tests.py
index b6b23ade9e..11edd81203 100644
--- a/tests/urlpatterns/tests.py
+++ b/tests/urlpatterns/tests.py
@@ -157,6 +157,19 @@ class SimplifiedURLTests(SimpleTestCase):
match = p.resolve('space%s/1/' % string.whitespace)
self.assertEqual(match.kwargs, {'num': 1})
+ 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):