Private
Public Access
1
0

mocking myqueue in most tests

This commit is contained in:
Sander Roosendaal
2019-02-10 15:54:09 +01:00
parent 9ec2b06338
commit 5becabb216
15 changed files with 75 additions and 11 deletions

View File

@@ -437,7 +437,9 @@ def remove_asynctask(request,id):
request.session['async_tasks'] = newtasks
def get_job_result(jobid):
if settings.DEBUG:
if settings.TESTING:
return None
elif settings.DEBUG:
result = celery_result.AsyncResult(jobid).result
else:
running_job_ids = rq_registry.get_job_ids()
@@ -467,7 +469,16 @@ verbose_job_status = {
}
def get_job_status(jobid):
if settings.DEBUG:
if settings.TESTING:
summary = {
'status': 'failed',
'result': 0,
'finished': True,
'failed': True,
'started_at':None,
}
return summary
elif settings.DEBUG:
job = celery_result.AsyncResult(jobid)
jobresult = job.result