'Test that tasks created outside the window of dates don\'t get changed,
while tasks created in the window do get changed.
Verifies that tasks in other states never get changed.'

@ddt.data(('2015-05-05', '2015-05-07', '2015-05-06', FAILURE), ('2015-05-05', '2015-05-07', '2015-05-08', QUEUING), ('2015-05-05', '2015-05-07', '2015-05-04', QUEUING))
@ddt.unpack
def test_tasks_updated(self, after, before, created, expected_state):

    self.update_task_created(created)
    call_command('fail_old_tasks', QUEUING, before=before, after=after)
    (type_1_queueing, type_1_progress, type_2_queueing) = self.get_tasks()
    self.assertEqual(type_1_queueing.task_state, expected_state)
    self.assertEqual(type_2_queueing.task_state, expected_state)
    self.assertEqual(type_1_progress.task_state, PROGRESS)
