mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #35569 -- Improved wording of invalid ForeignKey error message.
This commit is contained in:
@@ -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
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user