Ejemplo n.º 1
0
    def _create_temp_test_db(self):
        try:
            db.reflect()
            db.drop_all()
        except SQLAlchemyError:
            pass

        db.create_all()

        db.session.commit()
        db.session.flush()
Ejemplo n.º 2
0
    def master_test_teardown(self):
        # This is necessary to commit any pending transactions, which will make Postgres lock on DROP table queries
        db.session.commit()

        db.drop_all()