def test_delete_catalog_resource(self, mock_factory, mock_resp): """ Test that delete returns a serialized response containing a dict with the appropriate information. """ mock_manager = mock.MagicMock() mock_manager.purge.return_value = 82 mock_factory.content_catalog_manager.return_value = mock_manager request = mock.MagicMock() catalog_resource_view = CatalogResourceView() response = catalog_resource_view.delete(request, 'mock_id') expected_content = {'deleted': 82} mock_resp.assert_called_once_with(expected_content) self.assertTrue(response is mock_resp.return_value)
name='consumer_group_unassociate'), url(r'^v2/consumer_groups/(?P<consumer_group_id>[^/]+)/actions/content/(?P<action>[^/]+)/$', ConsumerGroupContentActionView.as_view(), name='consumer_group_content'), url(r'^v2/consumer_groups/(?P<consumer_group_id>[^/]+)/bindings/$', ConsumerGroupBindingsView.as_view(), name='consumer_group_bind'), url(r'^v2/consumer_groups/(?P<consumer_group_id>[^/]+)' + r'/bindings/(?P<repo_id>[^/]+)/(?P<distributor_id>[^/]+)/$', ConsumerGroupBindingView.as_view(), name='consumer_group_unbind'), url(r'^v2/content/actions/delete_orphans/$', DeleteOrphansActionView.as_view(), name='content_actions_delete_orphans'), url(r'^v2/content/catalog/(?P<source_id>[^/]+)/$', CatalogResourceView.as_view(), name='content_catalog_resource'), url(r'^v2/content/orphans/$', OrphanCollectionView.as_view(), name='content_orphan_collection'), url(r'^v2/content/orphans/(?P<content_type>[^/]+)/$', OrphanTypeSubCollectionView.as_view(), name='content_orphan_type_subcollection'), url(r'^v2/content/orphans/(?P<content_type>[^/]+)/(?P<unit_id>[^/]+)/$', OrphanResourceView.as_view(), name='content_orphan_resource'), url(r'^v2/content/types/$', ContentTypesView.as_view(), name='content_types'), url(r'^v2/content/types/(?P<type_id>[^/]+)/$', ContentTypeResourceView.as_view(),
url(r'^v2/consumer_groups/(?P<consumer_group_id>[^/]+)/$', ConsumerGroupResourceView.as_view(), name='consumer_group_resource'), url(r'^v2/consumer_groups/(?P<consumer_group_id>[^/]+)/actions/associate/$', ConsumerGroupAssociateActionView.as_view(), name='consumer_group_associate'), url(r'^v2/consumer_groups/(?P<consumer_group_id>[^/]+)/actions/unassociate/$', ConsumerGroupUnassociateActionView.as_view(), name='consumer_group_unassociate'), url(r'^v2/consumer_groups/(?P<consumer_group_id>[^/]+)/actions/content/(?P<action>[^/]+)/$', ConsumerGroupContentActionView.as_view(), name='consumer_group_content'), url(r'^v2/consumer_groups/(?P<consumer_group_id>[^/]+)/bindings/$', ConsumerGroupBindingsView.as_view(), name='consumer_group_bind'), url(r'^v2/consumer_groups/(?P<consumer_group_id>[^/]+)' + r'/bindings/(?P<repo_id>[^/]+)/(?P<distributor_id>[^/]+)/$', ConsumerGroupBindingView.as_view(), name='consumer_group_unbind'), url(r'^v2/content/actions/delete_orphans/$', DeleteOrphansActionView.as_view(), name='content_actions_delete_orphans'), url(r'^v2/content/catalog/(?P<source_id>[^/]+)/$', CatalogResourceView.as_view(), name='content_catalog_resource'), url(r'^v2/content/orphans/$', OrphanCollectionView.as_view(), name='content_orphan_collection'), url(r'^v2/content/orphans/(?P<content_type>[^/]+)/$', OrphanTypeSubCollectionView.as_view(), name='content_orphan_type_subcollection'), url(r'^v2/content/orphans/(?P<content_type>[^/]+)/(?P<unit_id>[^/]+)/$', OrphanResourceView.as_view(), name='content_orphan_resource'), url(r'^v2/content/sources/$', ContentSourceView.as_view(), name='content_sources'), url(r'^v2/content/sources/action/(?P<action>[^/]+)/$', ContentSourceView.as_view(), name='content_sources_action'), url(r'^v2/content/sources/(?P<source_id>[^/]+)/action/(?P<action>[^/]+)/$', ContentSourceResourceView.as_view(), name='content_sources_resource_action'), url(r'^v2/content/sources/(?P<source_id>[^/]+)/$', ContentSourceResourceView.as_view(), name='content_sources_resource'), url(r'^v2/content/types/$', ContentTypesView.as_view(),
url(r'^v2/consumer_groups/(?P<consumer_group_id>[^/]+)/$', ConsumerGroupResourceView.as_view(), name='consumer_group_resource'), url(r'^v2/consumer_groups/(?P<consumer_group_id>[^/]+)/actions/associate/$', ConsumerGroupAssociateActionView.as_view(), name='consumer_group_associate'), url(r'^v2/consumer_groups/(?P<consumer_group_id>[^/]+)/actions/unassociate/$', ConsumerGroupUnassociateActionView.as_view(), name='consumer_group_unassociate'), url(r'^v2/consumer_groups/(?P<consumer_group_id>[^/]+)/actions/content/(?P<action>[^/]+)/$', ConsumerGroupContentActionView.as_view(), name='consumer_group_content'), url(r'^v2/consumer_groups/(?P<consumer_group_id>[^/]+)/bindings/$', ConsumerGroupBindingsView.as_view(), name='consumer_group_bind'), url(r'^v2/consumer_groups/(?P<consumer_group_id>[^/]+)' + r'/bindings/(?P<repo_id>[^/]+)/(?P<distributor_id>[^/]+)/$', ConsumerGroupBindingView.as_view(), name='consumer_group_unbind'), url(r'^v2/content/actions/delete_orphans/$', DeleteOrphansActionView.as_view(), name='content_actions_delete_orphans'), url(r'^v2/content/catalog/(?P<source_id>[^/]+)/$', CatalogResourceView.as_view(), name='content_catalog_resource'), url(r'^v2/content/orphans/$', OrphanCollectionView.as_view(), name='content_orphan_collection'), url(r'^v2/content/orphans/(?P<content_type>[^/]+)/$', OrphanTypeSubCollectionView.as_view(), name='content_orphan_type_subcollection'), url(r'^v2/content/orphans/(?P<content_type>[^/]+)/(?P<unit_id>[^/]+)/$', OrphanResourceView.as_view(), name='content_orphan_resource'), url(r'^v2/content/sources/$', ContentSourceCollectionView.as_view(), name='content_sources'), url(r'^v2/content/sources/action/(?P<action>[^/]+)/$', ContentSourceCollectionActionView.as_view(), name='content_sources_action'), url(r'^v2/content/sources/(?P<source_id>[^/]+)/action/(?P<action>[^/]+)/$', ContentSourceResourceActionView.as_view(), name='content_sources_resource_action'), url(r'^v2/content/sources/(?P<source_id>[^/]+)/$', ContentSourceResourceView.as_view(),