

@classmethod
def _establish_connection_and_re_create_db(cls):
    username = (cfg.CONF.database.username if hasattr(cfg.CONF.database, 'username') else None)
    password = (cfg.CONF.database.password if hasattr(cfg.CONF.database, 'password') else None)
    cls.db_connection = db_setup(cfg.CONF.database.db_name, cfg.CONF.database.host, cfg.CONF.database.port, username=username, password=password, ensure_indexes=False)
    cls._drop_collections()
    cls.db_connection.drop_database(cfg.CONF.database.db_name)
    db_ensure_indexes()

dataset/ETHPy150Open StackStorm/st2/st2tests/st2tests/base.py BaseDbTestCase._establish_connection_and_re_create_db/original