mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #29322 -- Made admin check all ModelAdmin fieldsets for duplicates.
This commit is contained in:
committed by
Tim Graham
parent
0b66c3b442
commit
13efbb233a
@@ -166,6 +166,19 @@ class FieldsetsCheckTests(CheckTestCase):
|
||||
'admin.E012'
|
||||
)
|
||||
|
||||
def test_duplicate_fields_in_fieldsets(self):
|
||||
class TestModelAdmin(ModelAdmin):
|
||||
fieldsets = [
|
||||
(None, {'fields': ['name']}),
|
||||
(None, {'fields': ['name']}),
|
||||
]
|
||||
|
||||
self.assertIsInvalid(
|
||||
TestModelAdmin, ValidationTestModel,
|
||||
"There are duplicate field(s) in 'fieldsets[1][1]'.",
|
||||
'admin.E012'
|
||||
)
|
||||
|
||||
def test_fieldsets_with_custom_form_validation(self):
|
||||
class BandAdmin(ModelAdmin):
|
||||
fieldsets = (('Band', {'fields': ('name',)}),)
|
||||
|
||||
Reference in New Issue
Block a user