예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
    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')
예제 #4
0
    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')