'Test that only tasks with specified states are failed.'

@ddt.data((PROGRESS, QUEUING, FAILURE), (QUEUING, FAILURE, PROGRESS))
@ddt.unpack
def test_filter_by_task_state(self, task_type, expected_queueing_state, expected_progress_state):

    self.update_task_created('2015-05-06')
    call_command('fail_old_tasks', task_type, before='2015-05-07', after='2015-05-05')
    (type_1_queueing, type_1_progress, type_2_queueing) = self.get_tasks()
    self.assertEqual(type_1_queueing.task_state, expected_queueing_state)
    self.assertEqual(type_2_queueing.task_state, expected_queueing_state)
    self.assertEqual(type_1_progress.task_state, expected_progress_state)
