diff --git a/ckanext/spatial/tests/conftest.py b/ckanext/spatial/tests/conftest.py index 00bcb72..45a63d9 100644 --- a/ckanext/spatial/tests/conftest.py +++ b/ckanext/spatial/tests/conftest.py @@ -71,13 +71,13 @@ def spatial_setup(): if not table.exists(): create_postgis_tables() - # When running the tests with the --reset-db option for some - # reason the metadata holds a reference to the `package_extent` - # table after being deleted, causing an InvalidRequestError - # exception when trying to recreate it further on - if "package_extent" in meta.metadata.tables: - meta.metadata.remove(meta.metadata.tables["package_extent"]) - Session.execute("DROP INDEX idx_package_extent_the_geom") - Session.commit() + # When running the tests with the --reset-db option for some + # reason the metadata holds a reference to the `package_extent` + # table after being deleted, causing an InvalidRequestError + # exception when trying to recreate it further on + if "package_extent" in meta.metadata.tables: + meta.metadata.remove(meta.metadata.tables["package_extent"]) + Session.execute("DROP INDEX idx_package_extent_the_geom") + Session.commit() spatial_db_setup()