diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2020-08-25 14:33:05 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-08-26 11:59:37 +0200 |
| commit | 9c92924cd5d164701e2514e1c2d6574126bd7cc2 (patch) | |
| tree | fc423d33c20eea31f753c6cca05960a70a6f87d6 /tests/view_tests | |
| parent | b9be11d44265308863e4e8cfb458cd3605091452 (diff) | |
| download | django-9c92924cd5d164701e2514e1c2d6574126bd7cc2.tar.gz | |
Fixed #31942 -- Made settings cleansing work with dictionary settings with non-string keys.
Diffstat (limited to 'tests/view_tests')
| -rw-r--r-- | tests/view_tests/tests/test_debug.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py index bb5a45224d..6e839b44f5 100644 --- a/tests/view_tests/tests/test_debug.py +++ b/tests/view_tests/tests/test_debug.py @@ -1274,6 +1274,19 @@ class ExceptionReporterFilterTests(ExceptionReportTestMixin, LoggingCaptureMixin {'login': 'cooper', 'password': reporter_filter.cleansed_substitute}, ) + def test_cleanse_setting_recurses_in_dictionary_with_non_string_key(self): + reporter_filter = SafeExceptionReporterFilter() + initial = {('localhost', 8000): {'login': 'cooper', 'password': 'secret'}} + self.assertEqual( + reporter_filter.cleanse_setting('SETTING_NAME', initial), + { + ('localhost', 8000): { + 'login': 'cooper', + 'password': reporter_filter.cleansed_substitute, + }, + }, + ) + def test_cleanse_setting_recurses_in_list_tuples(self): reporter_filter = SafeExceptionReporterFilter() initial = [ |
