diff --git a/geonode/upload/handlers/tiles3d/handler.py b/geonode/upload/handlers/tiles3d/handler.py index 08a25443652..434b567f018 100755 --- a/geonode/upload/handlers/tiles3d/handler.py +++ b/geonode/upload/handlers/tiles3d/handler.py @@ -138,7 +138,7 @@ def validate_3dtile_payload(payload): if not volume: raise Invalid3DTilesException("The mandatory 'boundingVolume' for the key 'root' is missing") - error = payload.get("root", {}).get("geometricError", None) + error = payload.get("geometricError", None) or payload.get("root", {}).get("geometricError", None) if error is None: raise Invalid3DTilesException("The mandatory 'geometricError' for the key 'root' is missing") diff --git a/geonode/upload/handlers/tiles3d/tests.py b/geonode/upload/handlers/tiles3d/tests.py index 6aa3982d3e2..7ba1696f794 100755 --- a/geonode/upload/handlers/tiles3d/tests.py +++ b/geonode/upload/handlers/tiles3d/tests.py @@ -154,7 +154,6 @@ def test_validate_should_raise_exception_for_invalid_root_boundingVolume(self): def test_validate_should_raise_exception_for_invalid_root_geometricError(self): _json = { "asset": {"version": "1.1"}, - "geometricError": 1.0, "root": {"boundingVolume": {"box": []}, "foo": 0.0}, } _path = "/tmp/tileset.json" @@ -164,7 +163,10 @@ def test_validate_should_raise_exception_for_invalid_root_geometricError(self): self.handler.is_valid(files={"base_file": _path}, user=self.user) self.assertIsNotNone(_exc) - self.assertTrue("The mandatory 'geometricError' for the key 'root' is missing" in str(_exc.exception.detail)) + self.assertTrue( + "The provided 3DTiles is not valid, some of the mandatory keys are missing. Mandatory keys are: 'asset', 'geometricError', 'root'" + in str(_exc.exception.detail) + ) os.remove(_path) def test_get_ogr2ogr_driver_should_return_the_expected_driver(self): diff --git a/geonode/upload/tests/end2end/test_end2end.py b/geonode/upload/tests/end2end/test_end2end.py index f0a493b144e..176259b7199 100644 --- a/geonode/upload/tests/end2end/test_end2end.py +++ b/geonode/upload/tests/end2end/test_end2end.py @@ -457,7 +457,7 @@ def test_import_wms(self): "parse_remote_metadata": True, "action": "upload", } - initial_name = res.title + initial_name = res.title.lower().replace(" ", "_") assert_payload = { "subtype": "remote", "title": res.title,