diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-04-13 10:10:56 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-05-03 13:58:52 +0200 |
| commit | eed53d0011622e70b936e203005f0e6f4ac48965 (patch) | |
| tree | 175c2c28c419b7bbeda52bc80c53306a6b113062 /tests/forms_tests/widget_tests/test_clearablefileinput.py | |
| parent | 007e46d815063d598e0d3db78bfb371100e5c61c (diff) | |
[3.2.x] Fixed CVE-2023-31047, Fixed #31710 -- Prevented potential bypass of validation when uploading multiple files using one form field.
Thanks Moataz Al-Sharida and nawaik for reports.
Co-authored-by: Shai Berger <shai@platonix.com>
Co-authored-by: nessita <124304+nessita@users.noreply.github.com>
Diffstat (limited to 'tests/forms_tests/widget_tests/test_clearablefileinput.py')
| -rw-r--r-- | tests/forms_tests/widget_tests/test_clearablefileinput.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/forms_tests/widget_tests/test_clearablefileinput.py b/tests/forms_tests/widget_tests/test_clearablefileinput.py index dee44c4239..6cf1476cb2 100644 --- a/tests/forms_tests/widget_tests/test_clearablefileinput.py +++ b/tests/forms_tests/widget_tests/test_clearablefileinput.py @@ -176,3 +176,8 @@ class ClearableFileInputTest(WidgetTest): self.assertIs(widget.value_omitted_from_data({}, {}, 'field'), True) self.assertIs(widget.value_omitted_from_data({}, {'field': 'x'}, 'field'), False) self.assertIs(widget.value_omitted_from_data({'field-clear': 'y'}, {}, 'field'), False) + + def test_multiple_error(self): + msg = "ClearableFileInput doesn't support uploading multiple files." + with self.assertRaisesMessage(ValueError, msg): + ClearableFileInput(attrs={"multiple": True}) |
