def test_delete_exception(self, mock_tj, mock_log):
        tj = mock_tj.objects.get_subclass()
        tj.delete.side_effect = Exception('error')

        gizmo_jobs_table.delete(request='', job_id='1')

        mock_log.error.assert_called_with('The following error occurred when deleting job %s: %s', '1', 'error')
Beispiel #2
0
    def test_delete_exception(self, mock_tj, mock_log):
        tj = mock_tj.objects.get_subclass()
        tj.delete.side_effect = Exception('error')

        gizmo_jobs_table.delete(request='', job_id='1')

        mock_log.error.assert_called_with('The following error occurred when deleting job %s: %s', '1', 'error')
Beispiel #3
0
    def test_delete(self, mock_tj):
        tj = mock_tj.objects.get_subclass()
        tj.delete.return_value = mock.MagicMock()

        result = gizmo_jobs_table.delete(request='', job_id='1')

        self.assertEqual(200, result.status_code)
    def test_delete(self, mock_tj):
        tj = mock_tj.objects.get_subclass()
        tj.delete.return_value = mock.MagicMock()

        result = gizmo_jobs_table.delete(request='', job_id='1')

        self.assertEqual(200, result.status_code)