summaryrefslogtreecommitdiff
path: root/tests/model_forms
diff options
context:
space:
mode:
Diffstat (limited to 'tests/model_forms')
-rw-r--r--tests/model_forms/test_uuid.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/model_forms/test_uuid.py b/tests/model_forms/test_uuid.py
index 583b3fea94..b60ec93086 100644
--- a/tests/model_forms/test_uuid.py
+++ b/tests/model_forms/test_uuid.py
@@ -30,6 +30,15 @@ class ModelFormBaseTest(TestCase):
def test_model_multiple_choice_field_uuid_pk(self):
f = forms.ModelMultipleChoiceField(UUIDPK.objects.all())
with self.assertRaisesMessage(
- ValidationError, "“invalid_uuid” is not a valid UUID."
+ ValidationError, "“invalid_uuid” is not a valid value."
):
f.clean(["invalid_uuid"])
+
+ def test_model_choice_invalid_pk_value_error_messages(self):
+ f = forms.ModelChoiceField(UUIDPK.objects.all())
+ with self.assertRaisesMessage(
+ ValidationError,
+ "['Select a valid choice. "
+ "That choice is not one of the available choices.']",
+ ):
+ f.clean("invalid")