summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorafenoum <anja1catus@gmail.com>2026-03-26 11:30:02 +0300
committerJacob Walls <jacobtylerwalls@gmail.com>2026-03-26 15:21:00 -0400
commit8b7ea2bcdd7297941ca6beb72d93b9568e187349 (patch)
tree524931260dec3d917809ab720fc229e9568102e7 /tests
parentf6167b8bc881babd19b67c004e8f37954afc192e (diff)
Refs #36913 -- Maintained error message determinism in MultipleChoiceField.validate().
Used Django's OrderedSet datastructure instead of set() in MultipleChoiceField.validate() to prevent submission ordering from being discarded during validation. Thanks to Jacob Walls, JaeHyuck Sa, Jake Howard and Simon Charette for the reviews.
Diffstat (limited to 'tests')
-rw-r--r--tests/forms_tests/field_tests/test_multiplechoicefield.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/forms_tests/field_tests/test_multiplechoicefield.py b/tests/forms_tests/field_tests/test_multiplechoicefield.py
index 90a47ceee0..0ec53e1b30 100644
--- a/tests/forms_tests/field_tests/test_multiplechoicefield.py
+++ b/tests/forms_tests/field_tests/test_multiplechoicefield.py
@@ -91,5 +91,5 @@ class MultipleChoiceFieldTest(SimpleTestCase):
def test_validate_duplicated_invalid_values(self):
f = MultipleChoiceField(choices=[("1", "one"), ("2", "Two")])
- with self.assertRaises(ValidationError):
- f.validate(["1", "1", "invalid", "invalid"])
+ with self.assertRaisesMessage(ValidationError, "invalid-one"):
+ f.validate(["invalid-one", "invalid-one", "invalid-two"])