diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/unittest_decorators.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unittest_decorators.py b/test/unittest_decorators.py index b3321fc..1f92d55 100644 --- a/test/unittest_decorators.py +++ b/test/unittest_decorators.py @@ -102,5 +102,18 @@ class DecoratorsTC(TestCase): clear_cache(foo, 'foo') self.assertFalse(hasattr(foo, '_foo')) + def test_cached_property(self): + class Foo(object): + @property + @cached(cacheattr=u'_foo') + def foo(self): + """ what's up doc ? """ + foo = Foo() + foo.foo + self.assertEqual(foo._foo, None) + clear_cache(foo, 'foo') + self.assertFalse(hasattr(foo, '_foo')) + + if __name__ == '__main__': unittest_main() |