diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-06-09 07:45:12 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-06-09 08:58:41 +0200 |
| commit | 8f89454bbc873a117cc8614f2d1f1fbfd4e79ee4 (patch) | |
| tree | 1afe1352c26861151023aac46c9dfe72b3c6245c /tests/urlpatterns | |
| parent | fcd44b889f36c4be87910745614a0a4c88d7a3d8 (diff) | |
Refs #32195 -- Added path() test for invalid view.
Diffstat (limited to 'tests/urlpatterns')
| -rw-r--r-- | tests/urlpatterns/tests.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/urlpatterns/tests.py b/tests/urlpatterns/tests.py index 1cd3523ca5..aa593294af 100644 --- a/tests/urlpatterns/tests.py +++ b/tests/urlpatterns/tests.py @@ -141,6 +141,11 @@ class SimplifiedURLTests(SimpleTestCase): with self.assertRaisesMessage(ImproperlyConfigured, msg): path('foo/<nonexistent:var>/', empty_view) + def test_invalid_view(self): + msg = 'view must be a callable or a list/tuple in the case of include().' + with self.assertRaisesMessage(TypeError, msg): + path('articles/', 'invalid_view') + def test_whitespace_in_route(self): msg = ( "URL route 'space/<int:num>/extra/<str:%stest>' cannot contain " |
