示例#1
0
 def setUpClass(cls):
     cls.client = app.test_client()
     with app.app_context():
         init_db()
         update_db()
         settings.TESTING = True
         skf.app.initialize_app(app)
示例#2
0
 def setUpClass(cls):
     cls.client = app.test_client()
     with app.app_context():
         init_db()
         update_db()
         settings.TESTING = True
         skf.app.initialize_app(app)
示例#3
0
文件: app.py 项目: mzfr/skf-flask
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
示例#4
0
 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()
示例#5
0
 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)
示例#6
0
 def test_init_db(self):
     """Test if the init db is working"""
     self.assertTrue(init_db())
示例#7
0
def initdb_command():
    """Creates the database with all the Markdown files."""
    init_db()
    print('Initialized the database.')
示例#8
0
文件: app.py 项目: erdal-pb/skf-flask
def initdb_command():
    """Delete DB and creates a new database with all the Markdown files."""
    init_db()
    log.info("Created the database.")