Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some pydantic 2.0 DeprecationWarnings #289

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions stac_fastapi/tests/clients/test_elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,11 @@ async def test_create_item(ctx, core_client, txn_client):
resp = await core_client.get_item(
ctx.item["id"], ctx.item["collection"], request=MockRequest
)
assert Item(**ctx.item).dict(
assert Item(**ctx.item).model_dump(
exclude={"links": ..., "properties": {"created", "updated"}}
) == Item(**resp).dict(exclude={"links": ..., "properties": {"created", "updated"}})
) == Item(**resp).model_dump(
exclude={"links": ..., "properties": {"created", "updated"}}
)


@pytest.mark.asyncio
Expand Down
2 changes: 1 addition & 1 deletion stac_fastapi/tests/resources/test_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ async def test_field_extension_exclude_default_includes(app_client, ctx):
async def test_search_intersects_and_bbox(app_client):
"""Test POST search intersects and bbox are mutually exclusive (core)"""
bbox = [-118, 34, -117, 35]
geoj = Polygon.from_bounds(*bbox).dict(exclude_none=True)
geoj = Polygon.from_bounds(*bbox).model_dump(exclude_none=True)
params = {"bbox": bbox, "intersects": geoj}
resp = await app_client.post("/search", json=params)
assert resp.status_code == 400
Expand Down
Loading