def test_delete_task_collection_no_status(self, mock_task_status): """ Test get task_collection with no state. """ mock_request = mock.MagicMock() mock_request.GET.getlist.return_value = [] task_collection = TaskCollectionView() with self.assertRaises(pulp_exceptions.PulpCodedForbiddenException): task_collection.delete(mock_request)
def test_delete_task_collection(self, mock_task_status): """ Test get task_collection with tags. """ mock_request = mock.MagicMock() mock_request.GET.getlist.return_value = ['finished'] task_collection = TaskCollectionView() task_collection.delete(mock_request) mock_task_status.objects.assert_called_once_with(state='finished')