def test_delete_invalidates_context(self, m_delete):
     from pyramid_caching.ext.royal import CachedCollectionView
     context = mock.Mock()
     ccv = CachedCollectionView(context, None)
     ccv.cached_delete()
     context.invalidate.assert_called_once_with()
 def test_calls_delete(self, m_delete):
     from pyramid_caching.ext.royal import CachedCollectionView
     ccv = CachedCollectionView(mock.Mock(), None)
     response = ccv.cached_delete()
     m_delete.assert_called_once_with(ccv.context, ccv.request)
     self.assertEqual(m_delete.return_value, response)