summaryrefslogtreecommitdiff
path: root/tests/validation
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2024-07-03 07:51:50 -0400
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-07-04 11:35:03 +0200
commit31837dbcb36f1ab57fb1b16cb0b126c55a1bdf01 (patch)
tree6b99038a1fb308be9e208eebdf0c138e07da2b9b /tests/validation
parent704192e478885762411252979021771ba23b8adb (diff)
Fixed #35569 -- Improved wording of invalid ForeignKey error message.
Diffstat (limited to 'tests/validation')
-rw-r--r--tests/validation/tests.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/validation/tests.py b/tests/validation/tests.py
index 6bb04f6f14..494310e553 100644
--- a/tests/validation/tests.py
+++ b/tests/validation/tests.py
@@ -31,15 +31,18 @@ class BaseModelValidationTests(ValidationAssertions, TestCase):
self.assertFieldFailsValidationWithMessage(
mtv.full_clean,
"parent",
- ["model to validate instance with id %r does not exist." % mtv.parent_id],
+ [
+ "model to validate instance with id %r is not a valid choice."
+ % mtv.parent_id
+ ],
)
mtv = ModelToValidate(number=10, name="Some Name", ufm_id="Some Name")
self.assertFieldFailsValidationWithMessage(
mtv.full_clean,
"ufm",
[
- "unique fields model instance with unique_charfield %r does not exist."
- % mtv.name
+ "unique fields model instance with unique_charfield %r is not "
+ "a valid choice." % mtv.name
],
)