def setup(self):
    self.task1 = mock_task('task1', states.SUCCESS, 'the')
    self.task2 = mock_task('task2', states.SUCCESS, 'quick')
    self.task3 = mock_task('task3', states.FAILURE, KeyError('brown'))
    self.task4 = mock_task('task3', states.RETRY, KeyError('red'))
    for task in (self.task1, self.task2, self.task3, self.task4):
        save_result(self.app, task)

    @self.app.task(shared=False)
    def mytask():
        pass
    self.mytask = mytask
def setup(self):
    self.task1 = mock_task('task1', states.SUCCESS, 'the')
    self.task2 = mock_task('task2', states.SUCCESS, 'quick')
    self.task3 = mock_task('task3', states.FAILURE, KeyError('brown'))
    self.task4 = mock_task('task3', states.RETRY, KeyError('red'))
    for task in (self.task1, self.task2, self.task3, self.task4):
        save_result(self.app, task)

    @self.app.task(shared=False)
    def mytask():
        pass
    self.mytask = mytask