From 723feadd592fbf03d2e97f6e7d38e29b3c7aaa39 Mon Sep 17 00:00:00 2001 From: recalcitrantsupplant Date: Tue, 16 Dec 2025 15:48:31 +1000 Subject: [PATCH] fix: Test started failing for some other reason - not sure why it previously passed. Test did not properly test the described behaviour, so it has been updated to assert that numberMatched is not returned, (and set limit=1 such that, even though the count query is not run, the count is known as number returned < page limit). --- tests/test_listing_count_on_demand.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_listing_count_on_demand.py b/tests/test_listing_count_on_demand.py index 1d531911..1de17541 100644 --- a/tests/test_listing_count_on_demand.py +++ b/tests/test_listing_count_on_demand.py @@ -143,7 +143,7 @@ def test_geojson_listing_excludes_numberMatched(self, client): with patch.object(settings, "listing_count_on_demand", True): # Request GeoJSON listing without hits r = client.get( - "/catalogs/ex:DemoCatalog/collections/ex:GeoDataset/features/collections/ex:FeatureCollection/items?_mediatype=application/geo%2Bjson&_profile=ogcfeat-human" + "/catalogs/ex:DemoCatalog/collections/ex:GeoDataset/features/collections/ex:FeatureCollection/items?_mediatype=application/geo%2Bjson&_profile=ogcfeat-human&limit=1" ) assert r.status_code == 200 @@ -152,6 +152,7 @@ def test_geojson_listing_excludes_numberMatched(self, client): # Should have numberReturned (count of items in this response) assert "numberReturned" in geojson assert geojson["numberReturned"] >= 0 + assert "numberMatched" not in geojson # Should NOT have numberMatched (total count) # Note: numberMatched might be inferred if it's the first page and