Updated: Originally I didn't realize this only fails when run from unit tests.
I have a working task queue in AppEngine with Python. - When calling a view manually, the task is added to the queue and runs - When called from unit tests, adding the task to the queue fails with an UnknownQueueError.
When reading about others who've encountered this issue, there have been some suggestions of overriding taskqueue_stub
to fix this. But I'm not sure exactly how this should be done or why.
Edit: working answer. My problem was adding the stub fix in an individual unit test: moving it to setUp() fixed things.
In tests.py
from google.appengine.api import apiproxy_stub_map
import os
class BlahTest(MyAppTestCase)
def setUp(self):
'''Ensure dev appserver task queue knows where to find queue.yaml'''
taskqueue_stub = apiproxy_stub_map.apiproxy.GetStub( 'taskqueue' )
dircontainingqueuedotyaml = os.path.dirname(os.path.dirname( __file__ ))
taskqueue_stub._root_path = dircontainingqueuedotyaml
This now works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With