summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/view_tests/tests/test_debug.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py
index d885c22776..5c011a91b0 100644
--- a/tests/view_tests/tests/test_debug.py
+++ b/tests/view_tests/tests/test_debug.py
@@ -586,6 +586,16 @@ class ExceptionReporterFilterTests(TestCase, ExceptionReportTestMixin):
self.verify_safe_response(sensitive_kwargs_function_caller, check_for_POST_params=False)
self.verify_safe_email(sensitive_kwargs_function_caller, check_for_POST_params=False)
+ def test_callable_settings(self):
+ """
+ Callable settings should not be evaluated in the debug page (#21345).
+ """
+ def callable_setting():
+ return "This should not be displayed"
+ with self.settings(DEBUG=True, FOOBAR=callable_setting):
+ response = self.client.get('/views/raises500/')
+ self.assertNotContains(response, "This should not be displayed", status_code=500)
+
class AjaxResponseExceptionReporterFilter(TestCase, ExceptionReportTestMixin):
"""