diff options
| author | Curtis <curtis@tinbrain.net> | 2014-05-24 20:29:31 +1000 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-07-01 06:32:53 -0400 |
| commit | 71461b14ab0c5a3801d85738fde3aedd407d7115 (patch) | |
| tree | 7bfb432215d6f7a0293bb50b0f8d36e7c7341e4f /tests/utils_tests/test_functional.py | |
| parent | 34ba86706f0db33d9a0ab44e4abb78703e7262a9 (diff) | |
Fixed #22691 -- Added aliasing to cached_property.
Diffstat (limited to 'tests/utils_tests/test_functional.py')
| -rw-r--r-- | tests/utils_tests/test_functional.py | 9 |
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. |
