Refs #12679 -- Added test for using property as ModelAdmin.inlines.

Fixed in 1d8eb0cae5.
This commit is contained in:
Baptiste Mispelon 2019-12-13 22:00:54 +01:00 committed by Mariusz Felisiak
parent 5b7450080f
commit 4161e35048
1 changed files with 12 additions and 0 deletions

View File

@ -654,6 +654,18 @@ class SystemChecksTestCase(SimpleTestCase):
errors = MyAdmin(Album, AdminSite()).check() errors = MyAdmin(Album, AdminSite()).check()
self.assertEqual(errors, []) self.assertEqual(errors, [])
def test_inlines_property(self):
class CitiesInline(admin.TabularInline):
model = City
class StateAdmin(admin.ModelAdmin):
@property
def inlines(self):
return [CitiesInline]
errors = StateAdmin(State, AdminSite()).check()
self.assertEqual(errors, [])
def test_readonly(self): def test_readonly(self):
class SongAdmin(admin.ModelAdmin): class SongAdmin(admin.ModelAdmin):
readonly_fields = ("title",) readonly_fields = ("title",)