def create_app(self): self.app = create_app(PresentConfig) self.client = self.app.test_client() with self.app.app_context(): db.init_app(self.app) redis_cache.init_app(self.app) db.create_all() db.session.commit() return self.app
def create_app(config_filename): app.config.from_object(config_filename) global t if t == 0: app.register_blueprint(api_bp, url_prefix='/api') t = 1 if config_filename != TestingConfig: db.init_app(app) redis_cache.init_app(app) return app