diff --git a/tests/urlpatterns_reverse/tests.py b/tests/urlpatterns_reverse/tests.py index 8384f55b3c5..5843382a8c5 100644 --- a/tests/urlpatterns_reverse/tests.py +++ b/tests/urlpatterns_reverse/tests.py @@ -1456,7 +1456,7 @@ class RequestURLconfTests(SimpleTestCase): class ErrorHandlerResolutionTests(SimpleTestCase): - """Tests for handler400, handler404 and handler500""" + """Tests for handler400, handler403, handler404 and handler500""" def setUp(self): urlconf = "urlpatterns_reverse.urls_error_handlers" @@ -1465,12 +1465,12 @@ class ErrorHandlerResolutionTests(SimpleTestCase): self.callable_resolver = URLResolver(RegexPattern(r"^$"), urlconf_callables) def test_named_handlers(self): - for code in [400, 404, 500]: + for code in [400, 403, 404, 500]: with self.subTest(code=code): self.assertEqual(self.resolver.resolve_error_handler(code), empty_view) def test_callable_handlers(self): - for code in [400, 404, 500]: + for code in [400, 403, 404, 500]: with self.subTest(code=code): self.assertEqual( self.callable_resolver.resolve_error_handler(code), empty_view diff --git a/tests/urlpatterns_reverse/urls_error_handlers.py b/tests/urlpatterns_reverse/urls_error_handlers.py index 7261a97e07f..d483864f4b1 100644 --- a/tests/urlpatterns_reverse/urls_error_handlers.py +++ b/tests/urlpatterns_reverse/urls_error_handlers.py @@ -3,5 +3,6 @@ urlpatterns = [] handler400 = "urlpatterns_reverse.views.empty_view" +handler403 = "urlpatterns_reverse.views.empty_view" handler404 = "urlpatterns_reverse.views.empty_view" handler500 = "urlpatterns_reverse.views.empty_view" diff --git a/tests/urlpatterns_reverse/urls_error_handlers_callables.py b/tests/urlpatterns_reverse/urls_error_handlers_callables.py index 4a8d35116e5..614fc460fc6 100644 --- a/tests/urlpatterns_reverse/urls_error_handlers_callables.py +++ b/tests/urlpatterns_reverse/urls_error_handlers_callables.py @@ -5,5 +5,6 @@ from .views import empty_view urlpatterns = [] handler400 = empty_view +handler403 = empty_view handler404 = empty_view handler500 = empty_view