I bumped into this while unittesting and then running my app with
dev_appserver/production: unittests go fine but later I discover I don't
have required indexes (I'm using "dev_appserver.py ... --require_indexes")
So, I figured I'd do something like this in my setUp():
def setUp(self):
...
self.testbed = testbed.Testbed()
self.testbed.activate()
self.testbed.init_datastore_v3_stub(require_indexes=True)
dev_appserver_index.SetupIndexes(None, "%s/../" %
os.path.dirname(__file__))
I'm setting up datastore stub with require_indexes=True and later:
dev_appserver_index.SetupIndexes(None, "%s/../" % os.path.dirname(__file__))
- None tells it to use default app_id (whatever it is set to in app.yaml)
- second arg is the path to app root (I have my tests in app_root/tests dir)
Just posting this in case someone else finds it useful.
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-appengine/-/7SSy_C8IoE4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.