summaryrefslogtreecommitdiff
path: root/tests/admin_checks
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-07-07 08:06:01 +0200
committerGitHub <noreply@github.com>2023-07-07 08:06:01 +0200
commitf64fd47a7627ed6ffe2df2a32ded6ee528a784eb (patch)
tree1abf1f8f945e9b72a72d31ec00f356e1088c4538 /tests/admin_checks
parentd569c1dcfeb26ca9ee391e5dfeadedf2b5ed4253 (diff)
Fixed #9602 -- Added AdminSite.get_model_admin().
This allows retrieving an admin class for the given model class without using internal attributes.
Diffstat (limited to 'tests/admin_checks')
-rw-r--r--tests/admin_checks/tests.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/admin_checks/tests.py b/tests/admin_checks/tests.py
index 417c8504ed..d2d1eb219e 100644
--- a/tests/admin_checks/tests.py
+++ b/tests/admin_checks/tests.py
@@ -276,8 +276,7 @@ class SystemChecksTestCase(SimpleTestCase):
class MyBookAdmin(admin.ModelAdmin):
def check(self, **kwargs):
errors = super().check(**kwargs)
- author_admin = self.admin_site._registry.get(Author)
- if author_admin is None:
+ if not self.admin_site.is_registered(Author):
errors.append("AuthorAdmin missing!")
return errors