示例#1
0
    def _reset_test_db(self):
        engine = db_api.get_engine()
        meta = sqlalchemy.MetaData()
        meta.reflect(bind=engine)

        for table in reversed(meta.sorted_tables):
            if table.name == 'migrate_version':
                continue
            engine.execute(table.delete())
示例#2
0
 def _setup_test_db(self):
     engine = db_api.get_engine()
     db_api.db_sync(engine)
     engine.connect()