@@ -101,6 +101,17 @@ async def test_search_filter_ext_and_get(app_client, ctx):
101101 assert len (resp .json ()["features" ]) == 1
102102
103103
104+ @pytest .mark .asyncio
105+ async def test_search_filter_ext_and_get_id (app_client , ctx ):
106+ collection = ctx .item ["collection" ]
107+ id = ctx .item ["id" ]
108+ filter = f"id='{ id } ' AND collection='{ collection } '"
109+ resp = await app_client .get (f"/search?&filter={ filter } " )
110+
111+ assert resp .status_code == 200
112+ assert len (resp .json ()["features" ]) == 1
113+
114+
104115@pytest .mark .asyncio
105116async def test_search_filter_ext_and_get_cql2text_id (app_client , ctx ):
106117 collection = ctx .item ["collection" ]
@@ -162,21 +173,21 @@ async def test_search_filter_ext_and_post(app_client, ctx):
162173@pytest .mark .asyncio
163174async def test_search_filter_extension_floats_get (app_client , ctx ):
164175 resp = await app_client .get (
165- """/search?filter={"op":"and","args":[{"op":"=","args":[{"property":"id"},"test-item"]},{"op":">","args":[{"property":"properties.view:sun_elevation"},"-37.30891534"]},{"op":"<","args":[{"property":"properties.view:sun_elevation"},"-37.30691534"]}]}"""
176+ """/search?filter-lang=cql2-json&filter ={"op":"and","args":[{"op":"=","args":[{"property":"id"},"test-item"]},{"op":">","args":[{"property":"properties.view:sun_elevation"},"-37.30891534"]},{"op":"<","args":[{"property":"properties.view:sun_elevation"},"-37.30691534"]}]}"""
166177 )
167178
168179 assert resp .status_code == 200
169180 assert len (resp .json ()["features" ]) == 1
170181
171182 resp = await app_client .get (
172- """/search?filter={"op":"and","args":[{"op":"=","args":[{"property":"id"},"test-item-7"]},{"op":">","args":[{"property":"properties.view:sun_elevation"},"-37.30891534"]},{"op":"<","args":[{"property":"properties.view:sun_elevation"},"-37.30691534"]}]}"""
183+ """/search?filter-lang=cql2-json&filter ={"op":"and","args":[{"op":"=","args":[{"property":"id"},"test-item-7"]},{"op":">","args":[{"property":"properties.view:sun_elevation"},"-37.30891534"]},{"op":"<","args":[{"property":"properties.view:sun_elevation"},"-37.30691534"]}]}"""
173184 )
174185
175186 assert resp .status_code == 200
176187 assert len (resp .json ()["features" ]) == 0
177188
178189 resp = await app_client .get (
179- """/search?filter={"op":"and","args":[{"op":"=","args":[{"property":"id"},"test-item"]},{"op":">","args":[{"property":"properties.view:sun_elevation"},"-37.30591534"]},{"op":"<","args":[{"property":"properties.view:sun_elevation"},"-37.30491534"]}]}"""
190+ """/search?filter-lang=cql2-json&filter ={"op":"and","args":[{"op":"=","args":[{"property":"id"},"test-item"]},{"op":">","args":[{"property":"properties.view:sun_elevation"},"-37.30591534"]},{"op":"<","args":[{"property":"properties.view:sun_elevation"},"-37.30491534"]}]}"""
180191 )
181192
182193 assert resp .status_code == 200
0 commit comments