mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #9602 -- Added AdminSite.get_model_admin().
This allows retrieving an admin class for the given model class without using internal attributes.
This commit is contained in:
parent
d569c1dcfe
commit
f64fd47a76
15 changed files with 127 additions and 69 deletions
|
@ -871,7 +871,7 @@ class ModelAdminTests(TestCase):
|
|||
username="bob", email="bob@test.com", password="test"
|
||||
)
|
||||
self.site.register(Band, ModelAdmin)
|
||||
ma = self.site._registry[Band]
|
||||
ma = self.site.get_model_admin(Band)
|
||||
(
|
||||
deletable_objects,
|
||||
model_count,
|
||||
|
@ -898,7 +898,7 @@ class ModelAdminTests(TestCase):
|
|||
return False
|
||||
|
||||
self.site.register(Band, TestModelAdmin)
|
||||
ma = self.site._registry[Band]
|
||||
ma = self.site.get_model_admin(Band)
|
||||
(
|
||||
deletable_objects,
|
||||
model_count,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue