Wednesday, April 11, 2012

Django Google App Engine - Proper way to setup stub queues for management commands

I have a custom setup command that generates a bunch of initial seed/test data. We currently have some signals setup to kick off some (non-critical) deferred queue logic. What is the proper way to mock out the queues so I do not see the UnknownQueue error below?

Traceback (most recent call last):

File "../models/", line 207, in some_model_post_processing
deferred.defer(some_method,param1, param2,_queue="queue-create")

File "/Applications/", line 256, in defer
return task.add(queue, transactional=transactional)

File "/Applications/", line 1008, in add
return Queue(queue_name).add(self, transactional=transactional)

File "/Applications/", line 1546, in add
self._AddTasks(tasks, transactional, self._FillAddPushTasksRequest)

File "/Applications/", line 1609, in __AddTasks
raise exception

So i was just able to get "mock" the queues but is there a way to get the real queues initialized (aka ones that will actually run)?

Code that will initialize test mock queues:

path_to_queue_yaml= xxxxx
tb = testbed.Testbed()

No comments:

Post a Comment