def setUp(self): app.config.from_object('config') app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite://' self.app = app.test_client(use_cookies=False) with app.app_context(): db.create_all() self._create_roles()
def setUp(self): """ Uses an in memory sqlite database for testing """ app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite://' db.init_app(app) with app.app_context(): db.create_all() db.session.add(Role(role_type='admin')) db.session.add(Role(role_type='teacher')) db.session.add(Role(role_type='student')) db.session.commit()
def setUp(self): """ Uses an in memory sqlite database for testing """ app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite://" db.init_app(app) with app.app_context(): db.create_all()
def tearDown(self): """ Ensures that the database is emptied for next unit test """ app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite://" db.init_app(app) with app.app_context(): db.drop_all()
def tearDown(self): """ Ensures that the database is emptied for next unit test """ with app.app_context(): db.drop_all()