Fixed #31086 -- Improved error message for admin model inlines with more than one foreign key to the same parent.

This commit is contained in:
Shubham singh 2019-12-17 02:46:39 +05:30 committed by Mariusz Felisiak
parent ff00a05347
commit f4647179cc
3 changed files with 7 additions and 3 deletions

View file

@ -636,7 +636,9 @@ class SystemChecksTestCase(SimpleTestCase):
errors = MyAdmin(Album, AdminSite()).check()
expected = [
checks.Error(
"'admin_checks.TwoAlbumFKAndAnE' has more than one ForeignKey to 'admin_checks.Album'.",
"'admin_checks.TwoAlbumFKAndAnE' has more than one ForeignKey "
"to 'admin_checks.Album'. You must specify a 'fk_name' "
"attribute.",
obj=TwoAlbumFKAndAnEInline,
id='admin.E202',
)