summaryrefslogtreecommitdiff
path: root/tests/modeladmin
diff options
context:
space:
mode:
Diffstat (limited to 'tests/modeladmin')
-rw-r--r--tests/modeladmin/test_checks.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/modeladmin/test_checks.py b/tests/modeladmin/test_checks.py
index 73777f05ab..f767a6c92b 100644
--- a/tests/modeladmin/test_checks.py
+++ b/tests/modeladmin/test_checks.py
@@ -69,7 +69,7 @@ class RawIdCheckTests(CheckTestCase):
def test_missing_field(self):
class TestModelAdmin(ModelAdmin):
- raw_id_fields = ("non_existent_field",)
+ raw_id_fields = ["non_existent_field"]
self.assertIsInvalid(
TestModelAdmin,
@@ -602,8 +602,21 @@ class ListDisplayTests(CheckTestCase):
TestModelAdmin,
ValidationTestModel,
"The value of 'list_display[0]' refers to 'non_existent_field', "
- "which is not a callable, an attribute of 'TestModelAdmin', "
- "or an attribute or method on 'modeladmin.ValidationTestModel'.",
+ "which is not a callable or attribute of 'TestModelAdmin', "
+ "or an attribute, method, or field on 'modeladmin.ValidationTestModel'.",
+ "admin.E108",
+ )
+
+ def test_missing_related_field(self):
+ class TestModelAdmin(ModelAdmin):
+ list_display = ("band__non_existent_field",)
+
+ self.assertIsInvalid(
+ TestModelAdmin,
+ ValidationTestModel,
+ "The value of 'list_display[0]' refers to 'band__non_existent_field', "
+ "which is not a callable or attribute of 'TestModelAdmin', "
+ "or an attribute, method, or field on 'modeladmin.ValidationTestModel'.",
"admin.E108",
)