mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #23688 -- Updated cached_property to preserve docstring of original function
This commit is contained in:
parent
54e695331b
commit
dbf7a3df45
2 changed files with 5 additions and 0 deletions
|
@ -50,6 +50,7 @@ class FunctionalTestCase(unittest.TestCase):
|
|||
|
||||
@cached_property
|
||||
def value(self):
|
||||
"""Here is the docstring..."""
|
||||
return 1, object()
|
||||
|
||||
def other_value(self):
|
||||
|
@ -57,6 +58,9 @@ class FunctionalTestCase(unittest.TestCase):
|
|||
|
||||
other = cached_property(other_value, name='other')
|
||||
|
||||
# docstring should be preserved
|
||||
self.assertEqual(A.value.__doc__, "Here is the docstring...")
|
||||
|
||||
a = A()
|
||||
|
||||
# check that it is cached
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue