def resetDB(self): self.db.session.remove() self.db.drop_all() models.create_tables(self.app) fixtures.install(self.app, *fixtures.all_data) self.db = models.init_app(self.app)
def resetdb(): """Drops all tables and recreates them from scratch including fixtures.""" if not (app.debug or app.config['TESTING']): print "Application is not in debug mode!" else: db.drop_all() db.create_all() fixtures.install(db.session, *fixtures.all_data) db.session.commit()
def setUp(self): super(DatabaseMixin, self).setUp() db.init_app(self.app) db.drop_all() db.create_all() fixtures.install(db.session, *fixtures.all_data) db.session.flush()
def setUpClass(self): models.create_tables(self.app) fixtures.install(self.app, *fixtures.all_data) self.db = models.init_app(self.app)
def setUp(self): self.db.create_all() fixtures.install(self.app, *fixtures.all_data) identity_changed.send(current_app._get_current_object(), identity=Identity(1)) self.user = models.SyncUser.query.filter_by(id=1).first()
def setUpClass(self): models.create_tables(self.app) fixtures.install(self.app, *fixtures.organization_test_data) self.db = models.init_app(self.app)