Django testing in combination with celery
I am having trouble trying to evaluate how to test my application architecture. I already have 60% of my site complete, with full unit testing coverage (over all utility / lib functions, celery tasks as simple functions, etc.).
The problem comes when I try to test django views (simple functions) that do celery tasks (delay method).
def myview(request): ... mytask.delay(myval) ...
What should be the correct way to test these scenes without creating a new task execution?
The obvious way is to create a condition before each call to delay the task, which is executed only if it is not in the test environment but seems really messy.
source to share