mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #32494 -- Adjusted system check for raw_id_fields to warn about Field.attname.
This commit is contained in:
committed by
Mariusz Felisiak
parent
1da54bfe7d
commit
20ddc3b81d
@@ -84,6 +84,18 @@ class RawIdCheckTests(CheckTestCase):
|
||||
|
||||
self.assertIsValid(TestModelAdmin, ValidationTestModel)
|
||||
|
||||
def test_field_attname(self):
|
||||
class TestModelAdmin(ModelAdmin):
|
||||
raw_id_fields = ['band_id']
|
||||
|
||||
self.assertIsInvalid(
|
||||
TestModelAdmin,
|
||||
ValidationTestModel,
|
||||
"The value of 'raw_id_fields[0]' refers to 'band_id', which is "
|
||||
"not a field of 'modeladmin.ValidationTestModel'.",
|
||||
'admin.E002',
|
||||
)
|
||||
|
||||
|
||||
class FieldsetsCheckTests(CheckTestCase):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user