Unit testing task queues in AppEngine
- by Swizec Teller
For a very long time now I've been using task queues on AppEngine to schedule tasks, just the way I'm supposed to.
But what I've always been wondering is how does one write tests for that? Until now I've simply made tests to make sure an error doesn't occur on the API that queues a task and then wrote the more proper tests for the API executing the task.
However lately I've started feeling a bit unsatisfied by this and I'm searching for a way to actually test that the correct task has been added to the correct queue. Hopefully this can be done better than simply by deploying the code and hoping for the best.
I'm using django-nonrel, if that has any bearing on the answer.
To recap: How can a unit test be written to confirm tasks have been queued?