diff --git a/core/initializers.py b/core/initializers.py index 7a2474418..0533d9587 100644 --- a/core/initializers.py +++ b/core/initializers.py @@ -52,7 +52,7 @@ def init_hypertables(): def init_lexicon(path=None): if path is None: - path = Path("..") / "core" / "lexicon.json" + path = Path(__file__).parent / "lexicon.json" with open(path) as f: import json diff --git a/tests/conftest.py b/tests/conftest.py index 700f8637f..3a0cbe041 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -8,7 +8,7 @@ @pytest.fixture(scope="session") def location(): with session_ctx() as session: - loc = Location(point="SRID=4326;POINT(0 0)") + loc = Location(point="SRID=4326;POINT(0 0 0)") session.add(loc) session.commit() session.refresh(loc) @@ -22,7 +22,7 @@ def second_location(): with session_ctx() as session: location = Location( name="second location", - point="POINT (10.2 10.2)", + point="POINT (10.2 10.2 0)", release_status="draft", ) session.add(location) diff --git a/tests/test_geospatial.py b/tests/test_geospatial.py index 442e96004..5759a87d4 100644 --- a/tests/test_geospatial.py +++ b/tests/test_geospatial.py @@ -76,11 +76,11 @@ def populate(): loc1 = Location( name="Test Location 1", - point=geofunc.ST_GeomFromText("POINT(10.1 10.1)", srid=4326), + point=geofunc.ST_GeomFromText("POINT(10.1 10.1 0)", srid=4326), ) loc2 = Location( name="Test Location 2", - point=geofunc.ST_GeomFromText("POINT(20 20)", srid=4326), + point=geofunc.ST_GeomFromText("POINT(20 20 0)", srid=4326), ) session.add(loc1) session.add(loc2) diff --git a/tests/test_location.py b/tests/test_location.py index f69068c3f..f1056d75a 100644 --- a/tests/test_location.py +++ b/tests/test_location.py @@ -43,7 +43,7 @@ def override_dependencies_fixture(): def test_add_location(): payload = { "name": "test location", - "point": "POINT (10.1 10.1)", + "point": "POINT Z (10.1 10.1 0)", "release_status": "draft", } response = client.post("/location", json=payload) @@ -64,7 +64,7 @@ def test_add_location(): def test_update_location(location): payload = { - "point": "POINT (10.1 20.2)", + "point": "POINT Z (10.1 20.2 0)", "release_status": "draft", "name": "patched name", }