def setUp(self):
     app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///"
     with app.app_context():
         db.init_app(app)
         db.create_all()
     self.app = app.test_client()
     self.app_context = app.app_context
 def setUpClass(cls):
     '''
     Executes once per class for every test file
     :return:
     '''
     app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///'
     db.init_app(app)
Example #3
0
 def setUp(self):
     # Make sure database exists
     app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///'
     with app.app_context():
         db.init_app(app)
         db.create_all()
     # Get a test client
     self.app = app.test_client()
     self.app_context = app.app_context
Example #4
0
 def setUpClass(cls):
     app.config[
         'SQLALCHEMY_DATABASE_URI'] = BaseTest.SQLALCHEMY_DATABASE_URI
     app.config['DEBUG'] = False
     with app.app_context():
         db.init_app(app)
Example #5
0
from starter_code.app import app
from starter_code.db import db

db.init_app(app)


@app.before_first_request
def create_tables():
    db.create_all()
Example #6
0
 def setUpClass(cls):
     app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///'
     with app.app_context():
         db.init_app(app)
Example #7
0
 def setUpClass(cls):
     app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///'
     app.config['DEBUG'] = False
     app.config['PROPAGATION_EXCEPTION'] = True
     with app.app_context():
         db.init_app(app)