@@ -101,6 +101,17 @@ async def test_search_filter_ext_and_get(app_client, ctx):
101
101
assert len (resp .json ()["features" ]) == 1
102
102
103
103
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
+
104
115
@pytest .mark .asyncio
105
116
async def test_search_filter_ext_and_get_cql2text_id (app_client , ctx ):
106
117
collection = ctx .item ["collection" ]
@@ -162,21 +173,21 @@ async def test_search_filter_ext_and_post(app_client, ctx):
162
173
@pytest .mark .asyncio
163
174
async def test_search_filter_extension_floats_get (app_client , ctx ):
164
175
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"]}]}"""
166
177
)
167
178
168
179
assert resp .status_code == 200
169
180
assert len (resp .json ()["features" ]) == 1
170
181
171
182
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"]}]}"""
173
184
)
174
185
175
186
assert resp .status_code == 200
176
187
assert len (resp .json ()["features" ]) == 0
177
188
178
189
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"]}]}"""
180
191
)
181
192
182
193
assert resp .status_code == 200
0 commit comments