def test_workflow_does_not_reap(self): i = Instance(hostname='awx') i.save() j = WorkflowJob(status='running', execution_node='awx') j.save() reaper.reap(i) assert WorkflowJob.objects.first().status == 'running'
def mk_workflow_job(status='new', workflow_job_template=None, extra_vars={}, persisted=True): job = WorkflowJob(status=status, extra_vars=json.dumps(extra_vars)) job.workflow_job_template = workflow_job_template if persisted: job.save() return job