From 23e87c312fef601340489886fc661f3c4bc05e75 Mon Sep 17 00:00:00 2001 From: Edwin Gonzales Date: Mon, 21 Sep 2026 13:53:17 +0800 Subject: [PATCH 1/2] test(spp_api_v2_gis): deactivate every report and geofence before asserting the no-data export error An empty layer_ids means every active spp.gis.report is collected, and a report with zero features still counts as a layer. The test deactivated only its own two reports and geofences, so a demo module in the same database (spp_mis_demo_v2 ships four report records as data) supplied layers and the expected ValueError never came. Refs #443 --- spp_api_v2_gis/__manifest__.py | 2 +- spp_api_v2_gis/readme/HISTORY.md | 4 ++++ spp_api_v2_gis/tests/test_export_service.py | 13 ++++++------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/spp_api_v2_gis/__manifest__.py b/spp_api_v2_gis/__manifest__.py index e8616fc42..d56f7387e 100644 --- a/spp_api_v2_gis/__manifest__.py +++ b/spp_api_v2_gis/__manifest__.py @@ -2,7 +2,7 @@ { "name": "OpenSPP GIS API", "category": "OpenSPP/Integration", - "version": "19.0.2.0.1", + "version": "19.0.2.0.2", "sequence": 1, "author": "OpenSPP.org", "website": "https://github.com/OpenSPP/OpenSPP2", diff --git a/spp_api_v2_gis/readme/HISTORY.md b/spp_api_v2_gis/readme/HISTORY.md index bfdcdc497..2d076798e 100644 --- a/spp_api_v2_gis/readme/HISTORY.md +++ b/spp_api_v2_gis/readme/HISTORY.md @@ -1,3 +1,7 @@ +### 19.0.2.0.2 + +- test(api_v2_gis): the "export with no data raises" test deactivates every `spp.gis.report` and `spp.gis.geofence` in the database, not only the ones it created. With an empty `layer_ids` the export collects all active reports, and a demo module in the same database (`spp_mis_demo_v2` ships four report records as data) supplied layers, so the expected error never came. No behaviour change (#443) + ### 19.0.2.0.1 - fix: bind coordinate query parameters in the order the SQL expects diff --git a/spp_api_v2_gis/tests/test_export_service.py b/spp_api_v2_gis/tests/test_export_service.py index 98951ed88..703a6dfda 100644 --- a/spp_api_v2_gis/tests/test_export_service.py +++ b/spp_api_v2_gis/tests/test_export_service.py @@ -173,13 +173,12 @@ def test_export_no_data_raises_error(self): service = ExportService(self.env) - # Deactivate all reports - self.report1.active = False - self.report2.active = False - - # Deactivate all geofences - self.geofence1.active = False - self.geofence2.active = False + # Deactivate every report and geofence, not just this test's own: an + # empty layer_ids means "all active reports", and a demo module in the + # same database (spp_mis_demo_v2 ships four spp.gis.report records as + # data) would otherwise supply layers. Rolled back with the test. + self.env["spp.gis.report"].search([]).write({"active": False}) + self.env["spp.gis.geofence"].search([]).write({"active": False}) with self.assertRaises(ValueError) as context: service.export_geopackage( From 9c3e9419574e9cedaa89f40012d86aeb5fa225d2 Mon Sep 17 00:00:00 2001 From: Edwin Gonzales Date: Mon, 21 Sep 2026 14:12:14 +0800 Subject: [PATCH 2/2] docs(spp_api_v2_gis): regenerate README from fragments (CI output) --- spp_api_v2_gis/README.rst | 10 +++++++ spp_api_v2_gis/static/description/index.html | 30 ++++++++++++++------ 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/spp_api_v2_gis/README.rst b/spp_api_v2_gis/README.rst index 08d131107..251a215a6 100644 --- a/spp_api_v2_gis/README.rst +++ b/spp_api_v2_gis/README.rst @@ -161,6 +161,16 @@ Dependencies Changelog ========= +19.0.2.0.2 +~~~~~~~~~~ + +- test(api_v2_gis): the "export with no data raises" test deactivates + every ``spp.gis.report`` and ``spp.gis.geofence`` in the database, not + only the ones it created. With an empty ``layer_ids`` the export + collects all active reports, and a demo module in the same database + (``spp_mis_demo_v2`` ships four report records as data) supplied + layers, so the expected error never came. No behaviour change (#443) + 19.0.2.0.1 ~~~~~~~~~~ diff --git a/spp_api_v2_gis/static/description/index.html b/spp_api_v2_gis/static/description/index.html index 5e78ccec4..004e0a521 100644 --- a/spp_api_v2_gis/static/description/index.html +++ b/spp_api_v2_gis/static/description/index.html @@ -564,18 +564,30 @@

Dependencies

Changelog

-

19.0.2.0.1

+

19.0.2.0.2

+
    +
  • test(api_v2_gis): the “export with no data raises” test deactivates +every spp.gis.report and spp.gis.geofence in the database, not +only the ones it created. With an empty layer_ids the export +collects all active reports, and a demo module in the same database +(spp_mis_demo_v2 ships four report records as data) supplied +layers, so the expected error never came. No behaviour change (#443)
  • +
+
+
+

19.0.2.0.1

  • fix: bind coordinate query parameters in the order the SQL expects
  • fix: run the coordinate statistics query inside a savepoint so the @@ -593,15 +605,15 @@

    19.0.2.0.1

    re-land)
-
-

19.0.2.0.0

+
+

19.0.2.0.0

  • Initial migration to OpenSPP2
-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -609,7 +621,7 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.