Browse Source

🧪 Tweak test to make it a valid (failing) test

pull/14349/head
Sebastián Ramírez 8 months ago
parent
commit
f19797d18e
  1. 7
      tests/test_schema_ref_pydantic_v2.py

7
tests/test_schema_ref_pydantic_v2.py

@ -1,4 +1,5 @@
import sys
from typing import Any
from fastapi import FastAPI
from fastapi.testclient import TestClient
@ -19,9 +20,9 @@ class ModelWithRef(BaseModel):
model_config = ConfigDict(validate_by_alias=True, serialize_by_alias=True)
@app.get("/")
async def read_root() -> ModelWithRef:
return ModelWithRef(ref="some-ref")
@app.get("/", response_model=ModelWithRef)
async def read_root() -> Any:
return {"$ref": "some-ref"}
client = TestClient(app)

Loading…
Cancel
Save