1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #32421 -- Made admindocs ModelDetailView show model cached properties.

This commit is contained in:
Ramon Saraiva
2021-02-10 09:33:57 -03:00
committed by Mariusz Felisiak
parent 4372233ebf
commit dcb094abe8
5 changed files with 21 additions and 4 deletions

View File

@@ -232,6 +232,10 @@ class TestModelDetailView(TestDataMixin, AdminDocsTestCase):
"""Model properties are displayed as fields."""
self.assertContains(self.response, '<td>a_property</td>')
def test_instance_of_cached_property_methods_are_displayed(self):
"""Model cached properties are displayed as fields."""
self.assertContains(self.response, '<td>a_cached_property</td>')
def test_method_data_types(self):
company = Company.objects.create(name="Django")
person = Person.objects.create(first_name="Human", last_name="User", company=company)