Ejemplo n.º 1
0
    def setUp(self):
        app = create_app_test()
        self.app = app

        db.init_app(app)
        db.app = app
        with self.app.app_context():
            db.drop_all()
            db.create_all()
            complete_provisioning(db)
        self.app = app.test_client()
Ejemplo n.º 2
0
 def create_app(self):
     return create_app_test(
         'testing'
     )
Ejemplo n.º 3
0
import os
from app import create_app_test, db

__author__ = ["Clément Besnier <*****@*****.**>", ]


if __name__ == '__main__':
    # config_name = os.environ.get('FLASK_CONFIG') or 'development'
    # print(' * Loading configuration "{0}"'.format(config_name))

    if os.path.exists('data-test.sqlite3'):
        os.remove('data-test.sqlite3')
    app = create_app_test()
    app_context = app.app_context()
    app_context.push()
    db.create_all()
    app.run(debug=True)