summaryrefslogtreecommitdiff
path: root/tests/utils_tests/test_functional.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/utils_tests/test_functional.py')
-rw-r--r--tests/utils_tests/test_functional.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/utils_tests/test_functional.py b/tests/utils_tests/test_functional.py
index b6145ff0d0..e9010b3135 100644
--- a/tests/utils_tests/test_functional.py
+++ b/tests/utils_tests/test_functional.py
@@ -52,6 +52,11 @@ class FunctionalTestCase(unittest.TestCase):
def value(self):
return 1, object()
+ def other_value(self):
+ return 1
+
+ other = cached_property(other_value, name='other')
+
a = A()
# check that it is cached
@@ -67,6 +72,10 @@ class FunctionalTestCase(unittest.TestCase):
# check that it behaves like a property when there's no instance
self.assertIsInstance(A.value, cached_property)
+ # check that overriding name works
+ self.assertEqual(a.other, 1)
+ self.assertTrue(callable(a.other_value))
+
def test_lazy_equality(self):
"""
Tests that == and != work correctly for Promises.