mirror of
https://github.com/fastapi/sqlmodel.git
synced 2026-03-13 09:29:54 +08:00
✅ Update tests, remove conditionals for Pydantic v1 (#1702)
This commit is contained in:
committed by
GitHub
parent
2cc11dada3
commit
8dbcd643d3
@@ -2,7 +2,6 @@ import importlib
|
||||
from types import ModuleType
|
||||
|
||||
import pytest
|
||||
from dirty_equals import IsDict
|
||||
from fastapi.testclient import TestClient
|
||||
from sqlmodel import create_engine
|
||||
from sqlmodel.pool import StaticPool
|
||||
@@ -178,16 +177,10 @@ def test_tutorial(module: ModuleType):
|
||||
"properties": {
|
||||
"name": {"title": "Name", "type": "string"},
|
||||
"secret_name": {"title": "Secret Name", "type": "string"},
|
||||
"age": IsDict(
|
||||
{
|
||||
"title": "Age",
|
||||
"anyOf": [{"type": "integer"}, {"type": "null"}],
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{"title": "Age", "type": "integer"}
|
||||
),
|
||||
"age": {
|
||||
"title": "Age",
|
||||
"anyOf": [{"type": "integer"}, {"type": "null"}],
|
||||
},
|
||||
},
|
||||
},
|
||||
"HeroPublic": {
|
||||
@@ -197,16 +190,10 @@ def test_tutorial(module: ModuleType):
|
||||
"properties": {
|
||||
"name": {"title": "Name", "type": "string"},
|
||||
"secret_name": {"title": "Secret Name", "type": "string"},
|
||||
"age": IsDict(
|
||||
{
|
||||
"title": "Age",
|
||||
"anyOf": [{"type": "integer"}, {"type": "null"}],
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{"title": "Age", "type": "integer"}
|
||||
),
|
||||
"age": {
|
||||
"title": "Age",
|
||||
"anyOf": [{"type": "integer"}, {"type": "null"}],
|
||||
},
|
||||
"id": {"title": "Id", "type": "integer"},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user