def METHOD_NAME(self, mock_query):
    # Create a job that appears to be in progress
    job = HarvesterBackgroundTask.prepare("testuser")
    job.start()
    job.save(blocking=True)
    job2 = HarvesterBackgroundTask.prepare("testuser")
    task = HarvesterBackgroundTask(job2)
    BackgroundApi.execute(task)
    assert not mock_query.called, "mock_query was called when it shouldn't have been"
    time.sleep(1)
    job3 = models.BackgroundJob.pull(job2.id)
    assert job3.status == "error", "expected 'error', got '{x}'".format(x=job3.status)