def setUp(self): self.db = Database('reset_db_test') self.db_query = """SELECT datname FROM pg_database WHERE datistemplate=false;""" self.conn = connect() self.conn.autocommit = True
def install_extensions(extensions, **connection_parameters): """Install Postgres extension if available. Notes ----- - superuser is generally required for installing extensions. - Currently does not support specific schema. """ from postpy.connections import connect conn = connect(**connection_parameters) conn.autocommit = True for extension in extensions: install_extension(conn, extension)
def setUpClass(cls): cls.conn = connect() cls._prep()