I just got my functional tests without using the same settings as my dev_appserver. I am currently running my dev_appserver (non-rel) with require_indexes.
How to make my test bed use the same settings?
I tried using SetupIndexes
, but it didn’t “require” their definition in my index.yaml. I did not have the correct settings, and as a result, I can fulfill any request that I want.
i.e.
clz.testbed = Testbed() clz.testbed.activate() clz.testbed.init_memcache_stub() clz.testbed.init_taskqueue_stub() clz.testbed.init_urlfetch_stub() clz.testbed.init_datastore_v3_stub(use_sqlite=True, datastore_file=somepath) SetupIndexes('','') model.objects().filter(x=1, y=2.....) #will work regardless of index defined.
but when the request is executed on the server, I get
NeedIndexError: This query requires a composite index that is not defined. You must update the index.yaml file in the root of the application. The following index is the minimum required index:
source share