From 77558ec3bffa895ec03f86c5ea9a5c330a47818e Mon Sep 17 00:00:00 2001 From: Taro Matsuzawa Date: Thu, 7 Jan 2021 13:45:33 +0900 Subject: [PATCH] WIP: force remove index for package_extent --- ckanext/spatial/tests/conftest.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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()