Skip to content

Commit

Permalink
pydatnic 2.9 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalik committed Sep 17, 2024
1 parent 7c39ecc commit 40dc996
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/test_with_django/test_multi_param_parsing.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import re
import json
from pathlib import Path

Expand Down Expand Up @@ -105,9 +106,13 @@ def test_validate_test_data():
json.dump(schema["paths"][path], f, indent=2)
with Path(filename).open() as f:
data = json.load(f)
print("---" * 10, filename)
print(data)
assert json.loads(json.dumps(schema["paths"][path])) == data
path_schema = json.dumps(schema["paths"][path])
if "allOf" in path_schema:
# special case for pydantic 1.7 ... 2.9
path_schema = re.sub(
r'"allOf": \[\{"\$ref": "(.*?)"\}\]', r'"$ref": "\1"', path_schema
)
assert json.loads(path_schema) == data


@pytest.mark.parametrize("path, client_args", tuple(test_client_args.items()))
Expand Down

0 comments on commit 40dc996

Please sign in to comment.