1
0
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:
Claude Paroz
2015-04-21 21:54:00 +02:00
parent bd53db5eab
commit 70779d9c1c
9 changed files with 103 additions and 28 deletions

View File

@@ -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/')