Skip to content

Commit 6462bed

Browse files
committed
Add test
1 parent f8c7bea commit 6462bed

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/test_filters_jinja2.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,3 +314,26 @@ def test_item_get(
314314
else:
315315
assert response.status_code == 404
316316
assert response.json() == {"message": "Not found"}
317+
318+
319+
@pytest.mark.parametrize("is_authenticated", [True, False], ids=["auth", "anon"])
320+
async def test_search_post_empty_body(
321+
source_api_server,
322+
is_authenticated,
323+
token_builder,
324+
):
325+
"""Test that POST /search with empty body."""
326+
client = _build_client(
327+
src_api_server=source_api_server,
328+
template_expr="(properties.private = false)",
329+
is_authenticated=is_authenticated,
330+
token_builder=token_builder,
331+
)
332+
333+
# Send request with Content-Length header that doesn't match actual body size
334+
response = client.post(
335+
"/search",
336+
json={},
337+
)
338+
339+
assert response.status_code == 200

0 commit comments

Comments
 (0)