1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #34601 -- Added field name to check message for ModelAdmin.readonly_fields.

Co-authored-by: Rick van Hattem <wolph@wol.ph>
This commit is contained in:
nessita
2023-06-05 00:56:53 -03:00
committed by GitHub
parent f9936deed1
commit 89c27d8672
3 changed files with 12 additions and 8 deletions

View File

@@ -798,8 +798,9 @@ class SystemChecksTestCase(SimpleTestCase):
errors = SongAdmin(Song, AdminSite()).check()
expected = [
checks.Error(
"The value of 'readonly_fields[1]' is not a callable, an attribute "
"of 'SongAdmin', or an attribute of 'admin_checks.Song'.",
"The value of 'readonly_fields[1]' refers to 'nonexistent', which is "
"not a callable, an attribute of 'SongAdmin', or an attribute of "
"'admin_checks.Song'.",
obj=SongAdmin,
id="admin.E035",
)
@@ -814,8 +815,9 @@ class SystemChecksTestCase(SimpleTestCase):
errors = CityInline(State, AdminSite()).check()
expected = [
checks.Error(
"The value of 'readonly_fields[0]' is not a callable, an attribute "
"of 'CityInline', or an attribute of 'admin_checks.City'.",
"The value of 'readonly_fields[0]' refers to 'i_dont_exist', which is "
"not a callable, an attribute of 'CityInline', or an attribute of "
"'admin_checks.City'.",
obj=CityInline,
id="admin.E035",
)