Refs #12679 -- Added test for using property as ModelAdmin.inlines.
Fixed in 1d8eb0cae5
.
This commit is contained in:
parent
5b7450080f
commit
4161e35048
|
@ -654,6 +654,18 @@ class SystemChecksTestCase(SimpleTestCase):
|
|||
errors = MyAdmin(Album, AdminSite()).check()
|
||||
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):
|
||||
class SongAdmin(admin.ModelAdmin):
|
||||
readonly_fields = ("title",)
|
||||
|
|
Loading…
Reference in New Issue