def setUpClass(cls): cls.client = app.test_client() with app.app_context(): init_db() update_db() settings.TESTING = True skf.app.initialize_app(app)
def create_app(): flask_app = Flask(__name__) configure_app(flask_app) initialize_app(flask_app) db.init_app(flask_app) with flask_app.app_context(): init_db() return flask_app
def setUpClass(cls): cls.client = app.test_client() with app.app_context(): update_db() init_db() chatbot_tools.init_dataset() settings.TESTING = True app.app_context().push()
def setUp(self): self.client = app.test_client() with app.app_context(): init_db(True) settings.TESTING = True self.driver = webdriver.Chrome() driver = self.driver driver.get("http://localhost:4200/") username = driver.find_element_by_name("username") password = driver.find_element_by_name("password") username.send_keys("admin") password.send_keys("admin") password.send_keys(Keys.RETURN)
def test_init_db(self): """Test if the init db is working""" self.assertTrue(init_db())
def initdb_command(): """Creates the database with all the Markdown files.""" init_db() print('Initialized the database.')
def initdb_command(): """Delete DB and creates a new database with all the Markdown files.""" init_db() log.info("Created the database.")