diff options
| author | Hiroki KIYOHARA <hirokiky@gmail.com> | 2014-07-26 12:01:44 +0200 |
|---|---|---|
| committer | James Bennett <james@b-list.org> | 2014-07-26 14:48:25 +0200 |
| commit | 0d8d4fe9b4968364e40eb05eae5c7d30f9514516 (patch) | |
| tree | c8c321902bc9af975e08825a16e65959d1379c59 | |
| parent | bc3d401b9f95ebc5bd25488708b5a82074c53ebb (diff) | |
[1.7.x] Added test for the #23070 problem
Backport of e569144910e336d2f76a3a31998ec672377d31cc from master.
| -rw-r--r-- | tests/view_tests/tests/test_debug.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py index b66bdac32d..f799325ae4 100644 --- a/tests/view_tests/tests/test_debug.py +++ b/tests/view_tests/tests/test_debug.py @@ -652,6 +652,21 @@ class ExceptionReporterFilterTests(TestCase, ExceptionReportTestMixin): response = self.client.get('/raises500/') self.assertNotContains(response, "This should not be displayed", status_code=500) + def test_callable_settings_forbidding_to_set_attributes(self): + """ + Callable settings which forbid to set attributes should not break + the debug page (#23070). + """ + class CallableSettingWithSlots(object): + __slots__ = [] + + def __call__(self): + return "This should not be displayed" + + with self.settings(DEBUG=True, WITH_SLOTS=CallableSettingWithSlots()): + response = self.client.get('/raises500/') + self.assertNotContains(response, "This should not be displayed", status_code=500) + def test_dict_setting_with_non_str_key(self): """ A dict setting containing a non-string key should not break the |
