summaryrefslogtreecommitdiff
path: root/tests/forms_tests
diff options
context:
space:
mode:
authorT. Franzel <tfranzel@users.noreply.github.com>2023-03-11 00:34:13 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-03-21 19:44:41 +0100
commita2eaea8f22305b57dff3ab13add2e2887287bb6f (patch)
treea2f1acee503899e52a583572a46aeee0d1a5432c /tests/forms_tests
parent051d5944f86400b9b3476db60bc73de7e9964810 (diff)
downloaddjango-a2eaea8f22305b57dff3ab13add2e2887287bb6f.tar.gz
Fixed #34388 -- Allowed using choice enumeration types directly on model and form fields.
Diffstat (limited to 'tests/forms_tests')
-rw-r--r--tests/forms_tests/field_tests/test_choicefield.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/forms_tests/field_tests/test_choicefield.py b/tests/forms_tests/field_tests/test_choicefield.py
index bc580bbf02..e7893abe57 100644
--- a/tests/forms_tests/field_tests/test_choicefield.py
+++ b/tests/forms_tests/field_tests/test_choicefield.py
@@ -95,7 +95,8 @@ class ChoiceFieldTest(FormFieldAssertionsMixin, SimpleTestCase):
JOHN = "J", "John"
PAUL = "P", "Paul"
- f = ChoiceField(choices=FirstNames.choices)
+ f = ChoiceField(choices=FirstNames)
+ self.assertEqual(f.choices, FirstNames.choices)
self.assertEqual(f.clean("J"), "J")
msg = "'Select a valid choice. 3 is not one of the available choices.'"
with self.assertRaisesMessage(ValidationError, msg):