diff options
author | Eduardo Aldair Ahumada Garcia Jurado <eduardo.ahumadagj@gmail.com> | 2021-07-05 00:07:10 -0500 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-07-05 08:15:58 +0200 |
commit | e4da3654367cd5f5c06ab109ece0042631faaa02 (patch) | |
tree | 5fca7feaf47da8abb1790415948f7a8a0bd15c0b /tests/modeladmin | |
parent | fa35c8bdbc6aca65d94d6280fa463d5bc7baa5c0 (diff) | |
download | django-e4da3654367cd5f5c06ab109ece0042631faaa02.tar.gz |
Refs #24121 -- Added __repr__() to AdminSite, DefaultAdminSite, and ModelAdmin.
Thanks tlebrize for the initial patch.
Diffstat (limited to 'tests/modeladmin')
-rw-r--r-- | tests/modeladmin/tests.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/modeladmin/tests.py b/tests/modeladmin/tests.py index 00de9f7523..42cc369a9e 100644 --- a/tests/modeladmin/tests.py +++ b/tests/modeladmin/tests.py @@ -722,6 +722,13 @@ class ModelAdminTests(TestCase): self.assertEqual(perms_needed, {'band'}) self.assertEqual(protected, []) + def test_modeladmin_repr(self): + ma = ModelAdmin(Band, self.site) + self.assertEqual( + repr(ma), + "<ModelAdmin: model=Band site=AdminSite(name='admin')>", + ) + class ModelAdminPermissionTests(SimpleTestCase): |