mocking myqueue in most tests
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user