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)
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
def setUpClass(cls): app.config[ 'SQLALCHEMY_DATABASE_URI'] = BaseTest.SQLALCHEMY_DATABASE_URI app.config['DEBUG'] = False with app.app_context(): db.init_app(app)
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()
def setUpClass(cls): app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' with app.app_context(): db.init_app(app)
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)