def test_invalidate_collection_key(self): from pyramid_caching.ext.royal import CachedCollection, Root request = mock.Mock() root = Root(request) resource = CachedCollection('myname', root) resource.invalidate() request.versioner.incr.assert_called_once_with(('myname',))
def test_invalidate_item_key(self): from pyramid_caching.ext.royal import CachedCollection, Root request = mock.Mock() root = Root(request) coll = CachedCollection('mycoll', root) resource = CachedCollection('myitem', coll) resource.invalidate() request.versioner.incr.assert_called_once_with( ('myitem', {'mycoll': 'myitem'}))