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:54:21 +0200
commite7c3a2ccc3a562328600be05068ed9149e12ce64 (patch)
tree1d09f4922767c53693d30c407764f5e2d079cda2 /tests/forms_tests/widget_tests/test_clearablefileinput.py
parent491dccec1aa10e829539e4e4fcd8cca606a57ebc (diff)
[4.1.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 fb6a2f6b72..0b343357dd 100644
--- a/tests/forms_tests/widget_tests/test_clearablefileinput.py
+++ b/tests/forms_tests/widget_tests/test_clearablefileinput.py
@@ -232,3 +232,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})