def transact(self, request, configfile, waitForDb):
     self.app = create_app(configfile, waitForDb)
     self.test_client = self.app.test_client()
     self.app_context = self.app.app_context()
     self.app_context.push()
     self.test_user_name = 'testuserusers'
     self.test_user_password = '******'
     db.create_all()
     yield
     db.session.remove()
     db.drop_all()
     self.app_context.pop()
示例#2
0
 def setUp(self) -> None:
     self.app = create_app()
     self.client = self.app.test_client()
示例#3
0
def app():
    app = create_app({'debug': True})
    return app
示例#4
0
import sys
from web.server import create_app
from web.db import db

configFile = "config"
if len(sys.argv) > 1:
    configFile = sys.argv[1]

app = create_app(configFile)

if __name__ == '__main__':
    # Create in the db the tables that are missing
    app_context = app.app_context()
    app_context.push()
    db.create_all()

    # start the app
    app.run(host='0.0.0.0', port=80, debug=True, use_reloader=False)