def create_db(self): """ Prepares the database so it it ready for testing """ # We start by dropping everything to avoid duplicates when previous # test didn't go well and couldn't tear down db.drop_all() # And create db.create_all() user = User('admin', 'admin', True) db.session.add(user) db.session.commit()
def create_db(self): """ Prepares the database so it it ready for testing """ # We start by dropping everything to avoid duplicates when previous # test didn't go well and couldn't tear down db.drop_all() # And create db.create_all() user = User("admin", "admin", True) db.session.add(user) db.session.commit()
def tearDown(self): """ Cleans up resources used by a test """ db.session.remove() db.drop_all() pass