mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #24733 -- Passed the triggering exception to 40x error handlers
Thanks Tim Graham for the review.
This commit is contained in:
@@ -81,7 +81,7 @@ class DebugViewTests(LoggingCaptureMixin, TestCase):
|
||||
'OPTIONS': {
|
||||
'loaders': [
|
||||
('django.template.loaders.locmem.Loader', {
|
||||
'403.html': 'This is a test template for a 403 error.',
|
||||
'403.html': 'This is a test template for a 403 error ({{ exception }}).',
|
||||
}),
|
||||
],
|
||||
},
|
||||
@@ -89,6 +89,7 @@ class DebugViewTests(LoggingCaptureMixin, TestCase):
|
||||
def test_403_template(self):
|
||||
response = self.client.get('/raises403/')
|
||||
self.assertContains(response, 'test template', status_code=403)
|
||||
self.assertContains(response, '(Insufficient Permissions).', status_code=403)
|
||||
|
||||
def test_404(self):
|
||||
response = self.client.get('/raises404/')
|
||||
|
||||
Reference in New Issue
Block a user