@@ -58,51 +58,6 @@ async def test_request_params_valid(request_valid, defaults, input_bbox, expecte
5858 )
5959
6060
61- async def test_count_search (request_valid , defaults , mock_search , mock_search_result ):
62- """
63- Test the count setting during a search.
64- """
65- count = get_settings ().count
66- qs = f"search?collections={ defaults .collection } "
67-
68- assert count is False , "Default count setting should be False"
69- response = await request_valid (
70- qs ,
71- expected_search_kwargs = dict (
72- collection = defaults .collection ,
73- token = None ,
74- items_per_page = DEFAULT_ITEMS_PER_PAGE ,
75- raise_errors = False ,
76- count = False , # Ensure count is set to False
77- validate = True ,
78- ),
79- )
80- assert response ["numberMatched" ] is None
81-
82- # Reset search mock, set "number_matched" attribute of the search results mock for a counting search
83- # and set count to True
84- mock_search .reset_mock ()
85- search_result = mock_search_result
86- search_result .number_matched = len (search_result )
87- get_settings ().count = True
88-
89- response = await request_valid (
90- qs ,
91- expected_search_kwargs = dict (
92- collection = defaults .collection ,
93- token = None ,
94- items_per_page = DEFAULT_ITEMS_PER_PAGE ,
95- raise_errors = False ,
96- count = True , # Ensure count is set to True
97- validate = True ,
98- ),
99- )
100- assert response ["numberMatched" ] == 2
101-
102- # Reset count setting to default
103- get_settings ().count = count
104-
105-
10661async def test_items_response (request_valid , defaults ):
10762 """Returned items properties must be mapped as expected"""
10863 resp_json = await request_valid (
@@ -507,7 +462,6 @@ async def test_ids_post_search(request_valid, defaults):
507462async def test_search_response_contains_pagination_info (request_valid , defaults ):
508463 """Responses to valid search requests must return a geojson with pagination info in properties"""
509464 response = await request_valid (f"search?collections={ defaults .collection } " )
510- assert "numberMatched" in response
511465 assert "numberReturned" in response
512466
513467
0 commit comments