Skip to content

Commit 86978d5

Browse files
author
Andrei Neagu
committed
fixed tests
1 parent fdafe9f commit 86978d5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/models-library/tests/test_rest_filters.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ def test_custom_filter_query_parameters():
2020
# 2. use generic as query parameters
2121
logging.info(
2222
"json schema is for the query \n %s",
23-
FiltersQueryParameters[CustomFilter].schema_json(indent=1),
23+
FiltersQueryParameters[CustomFilter].model_json_schema(),
2424
)
2525

2626
# lets filter only is_trashed and unset is_hidden
2727
custom_filter = CustomFilter(is_trashed=True)
28-
assert custom_filter.model_dump_json() == '{"is_trashed": true, "is_hidden": null}'
28+
assert custom_filter.model_dump_json() == '{"is_trashed":true,"is_hidden":null}'
2929

3030
# default to None (optional)
3131
query_param = FiltersQueryParameters[CustomFilter]()
@@ -55,9 +55,8 @@ def test_invalid_filter_query_is_ignored():
5555
assert query_param.filters == CustomFilter(is_hidden=True)
5656

5757

58-
@pytest.mark.xfail
5958
def test_invalid_filter_query_fails():
60-
# NOTE: this should fail according to pydantic manual but it does not
59+
# with pydantic1 this used to not pass but now passes
6160
url_query_value = '{"undefined_filter": true, "is_hidden": true}'
6261

6362
with pytest.raises(ValidationError):

0 commit comments

Comments
 (0)