def test_doesnt_raise_on_unknown_attribute(self): safe_clear_cached_property(self.instance, "bar")
def bust_cache(self): """Clear relevant caches for this instance.""" safe_clear_cached_property(self, "is_nsfw") safe_clear_cached_property(self, "rendered")
def test_clears_attribute(self): safe_clear_cached_property(self.instance, "foo") self.assertFalse(hasattr(self.instance, "foo"))