summaryrefslogtreecommitdiff
path: root/tests/forms_tests/widget_tests/test_clearablefileinput.py
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-04-13 10:10:56 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-05-03 13:43:16 +0200
commit21b1b1fc03e5f9e9f8c977ee6e35618dd3b353dd (patch)
tree0fc243d8c7e71dae06ace8c746fc88d24d52fed3 /tests/forms_tests/widget_tests/test_clearablefileinput.py
parent290fd5ecece400490ad6bb557720d3b76f647eaf (diff)
[4.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.py5
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 4fbaec0910..a9b0667ca9 100644
--- a/tests/forms_tests/widget_tests/test_clearablefileinput.py
+++ b/tests/forms_tests/widget_tests/test_clearablefileinput.py
@@ -242,3 +242,8 @@ class ClearableFileInputTest(WidgetTest):
'<input type="file" name="clearable_file" id="id_clearable_file"></div>',
form.render(),
)
+
+ def test_multiple_error(self):
+ msg = "ClearableFileInput doesn't support uploading multiple files."
+ with self.assertRaisesMessage(ValueError, msg):
+ ClearableFileInput(attrs={"multiple": True})