From 920448539631b52dcee53bd32a880abbc9de18bd Mon Sep 17 00:00:00 2001 From: Nick Pope Date: Wed, 13 Jan 2021 16:19:22 +0000 Subject: Fixed #16117 -- Added decorators for admin action and display functions. Refs #25134, #32099. --- tests/admin_checks/tests.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/admin_checks/tests.py') diff --git a/tests/admin_checks/tests.py b/tests/admin_checks/tests.py index 5744dc1b39..139b6dec59 100644 --- a/tests/admin_checks/tests.py +++ b/tests/admin_checks/tests.py @@ -692,6 +692,7 @@ class SystemChecksTestCase(SimpleTestCase): self.assertEqual(errors, []) def test_readonly_on_method(self): + @admin.display def my_function(obj): pass @@ -705,6 +706,7 @@ class SystemChecksTestCase(SimpleTestCase): class SongAdmin(admin.ModelAdmin): readonly_fields = ("readonly_method_on_modeladmin",) + @admin.display def readonly_method_on_modeladmin(self, obj): pass @@ -717,6 +719,7 @@ class SystemChecksTestCase(SimpleTestCase): def __getattr__(self, item): if item == "dynamic_method": + @admin.display def method(obj): pass return method @@ -777,6 +780,7 @@ class SystemChecksTestCase(SimpleTestCase): def test_extra(self): class SongAdmin(admin.ModelAdmin): + @admin.display def awesome_song(self, instance): if instance.title == "Born to Run": return "Best Ever!" -- cgit v1.2.1