コード例 #1
0
def test_setup_extensions_old_postgis(temp_db_conn, monkeypatch):
    monkeypatch.setattr(database_import, 'POSTGIS_REQUIRED_VERSION', (50, 50))

    with pytest.raises(UsageError, match='PostGIS version is too old.'):
        database_import.setup_extensions(temp_db_conn)
コード例 #2
0
def test_setup_extensions(temp_db_conn, temp_db_cursor):
    database_import.setup_extensions(temp_db_conn)

    temp_db_cursor.execute(
        'CREATE TABLE t (h HSTORE, geom GEOMETRY(Geometry, 4326))')