python - Task queue works from view, but UnknownQueueError when run from unit tests -


Renewed : Renewed : Originally I did not know that it will only fail when running with unit tests goes.

I have a working line in AppEngine with Python - while manually calling a view, the job is added to the queue and runs - when called from the unit test, the task in the queue Adds fail with UnknownQueueError .

When the problem is faced with reading about other people, then some suggestions have been given to override the TaskQ_stube to fix this, but I'm not sure How should this be done or why?

Edit: The answer to my job was adding stub fixes to a personal unit test: set it Up () to move in the fixes.

Import from google.appengine.api Import

  Apiproxy_stub_map Import OS Class BlahTest (MyAppTestCase) Def Setup (self): '' 'Make sure that the Dev application server The working queue knows where queue.yaml '' '' 'taskqueue_stub = apiproxy_stub_map.apiproxy.getstub' ('taskscu') is dircontainingqueuedotyaml = os.path. Dirname (os.path.dirname (__file__)) taskqueue_stub._root_path = dircontainingqueuedotyll   

It works now.

Comments