django nonrel - require_indexes when unit testing on djangoappengine -
i'm trying reduce , clean datastore indexes on gae datastore, set require_indexes=true. removed indexes , ran unit tests, tests pass without issue , there no changes made gae sdk index.yaml. why passing?????
i think solution djangoappengine.sb.stubs.activate_test_stubs needs updated follows require , setup indexes:
def activate_test_stubs(self, connection): if self.active_stubs == 'test': return os.environ['http_host'] = "%s.appspot.com" % appid appserver_opts = connection.settings_dict.get('dev_appserver_options', {}) high_replication = appserver_opts.get('high_replication', false) require_indexes = appserver_opts.get('require_indexes', false) datastore_opts = {'require_indexes': require_indexes} if high_replication: google.appengine.datastore import datastore_stub_util datastore_opts['consistency_policy'] = datastore_stub_util.pseudorandomhrconsistencypolicy(probability=1) if self.testbed none: google.appengine.ext.testbed import testbed self.testbed = testbed() self.testbed.activate() self.pre_test_stubs = self.active_stubs self.active_stubs = 'test' self.testbed.init_datastore_v3_stub(root_path=project_dir, **datastore_opts) self.testbed.init_memcache_stub() self.testbed.init_taskqueue_stub(auto_task_running=true, root_path=project_dir) self.testbed.init_urlfetch_stub() self.testbed.init_user_stub() self.testbed.init_xmpp_stub() self.testbed.init_channel_stub() if require_indexes: google.appengine.tools import dev_appserver_index dev_appserver_index.setupindexes(none, none)
alex burgel has updated djangoappengine on github these changes.
Comments
Post a Comment