summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/admin_util/tests.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/admin_util/tests.py b/tests/admin_util/tests.py
index 7898f200b5..35b7681cbb 100644
--- a/tests/admin_util/tests.py
+++ b/tests/admin_util/tests.py
@@ -236,6 +236,20 @@ class UtilTests(unittest.TestCase):
("not Really the Model", MockModelAdmin.test_from_model)
)
+ def test_label_for_property(self):
+ # NOTE: cannot use @property decorator, because of
+ # AttributeError: 'property' object has no attribute 'short_description'
+ class MockModelAdmin(object):
+ def my_property(self):
+ return "this if from property"
+ my_property.short_description = 'property short description'
+ test_from_property = property(my_property)
+
+ self.assertEqual(
+ label_for_field("test_from_property", Article, model_admin=MockModelAdmin),
+ 'property short description'
+ )
+
def test_related_name(self):
"""
Regression test for #13963