def test_cached_item_calls_not_allowed(self, m_not_allowed): from pyramid_caching.ext.royal import CachedItemView context = mock.Mock() civ = CachedItemView(context, None) response = civ.cached_not_allowed() m_not_allowed.assert_called_once_with(civ.context, civ.request) self.assertEqual(m_not_allowed.return_value, response)
def test_cached_item_calls_post(self, m_post): from pyramid_caching.ext.royal import CachedItemView civ = CachedItemView(mock.Mock(), None) civ.cached_post() m_post.assert_called_once_with()
def test_cached_item_update_invalidates_context(self, m_patch): from pyramid_caching.ext.royal import CachedItemView context = mock.Mock() civ = CachedItemView(context, None) civ.cached_update() context.invalidate.assert_called_once_with()
def test_cached_item_calls_update(self, m_patch): from pyramid_caching.ext.royal import CachedItemView civ = CachedItemView(mock.Mock(), None) response = civ.cached_update() m_patch.assert_called_once_with() self.assertEqual(m_patch.return_value, response)
def test_cached_item_calls_show(self, m_show): from pyramid_caching.ext.royal import CachedItemView civ = CachedItemView(None, None) response = civ.cached_show() m_show.assert_called_once_with() self.assertEqual(m_show.return_value, response)
def test_cached_item_calls_delete(self, m_delete): from pyramid_caching.ext.royal import CachedItemView civ = CachedItemView(mock.Mock(), None) response = civ.cached_delete() m_delete.assert_called_once_with(civ.context, civ.request) self.assertEqual(m_delete.return_value, response)