def test_calls_not_allowed(self, m_not_allowed):
     from pyramid_caching.ext.royal import CachedCollectionView
     context = mock.Mock()
     ccv = CachedCollectionView(context, None)
     response = ccv.cached_not_allowed()
     m_not_allowed.assert_called_once_with(ccv.context, ccv.request)
     self.assertEqual(m_not_allowed.return_value, response)
 def test_calls_index(self, m_index):
     from pyramid_caching.ext.royal import CachedCollectionView
     ccv = CachedCollectionView(None, None)
     response = ccv.cached_index()
     m_index.assert_called_once_with()
     self.assertEqual(m_index.return_value, response)
 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)