def activate_testing(self): self.app.config['TESTING'] = True self.app.app_context().push() User.CreateNeoAdmin(self.config.admin_password) init_default_content(self.config.beta_user1_password, self.config.beta_user2_password) return self.app.test_client()
def create_app(config): neo = NeoAPI(config) if config.use_redis: sockets.storage.set_conf(config.use_redis, config.redis_url) with neo.app.app_context(): User.CreateNeoAdmin(config.admin_password) init_default_content(config.beta_user1_password, config.beta_user2_password) return neo.app