def test_create_postgis(self): database.enable_postgis(self.app_id) cur = self.conn.cursor() cur.execute("select 3+3;") self.assertEqual(cur.fetchone()[0], 6) cur.execute("select postgis_lib_version();") self.assertEqual(cur.fetchone()[0], "1.5.1")
def enable_postgis(job_id, zoomdb, job_params, log_step_events=True): step_label = "Enabling PostGIS Extensions on Database" if log_step_events: zoomdb.log(step_label, zoomdb.LOG_STEP_BEGIN) zoomdb.log("Installing PostGIS into database...") sql_output = database.enable_postgis(job_params["app_id"]) zoomdb.mark_postgis_enabled() zoomdb.log("Command output:\n" + sql_output) if log_step_events: zoomdb.log(step_label, zoomdb.LOG_STEP_END)