mirror of
https://github.com/fastapi/fastapi.git
synced 2026-05-14 18:55:52 -04:00
📝 Update docs about re-raising validation errors, do not include string as is to not leak information (#14487)
This commit is contained in:
committed by
GitHub
parent
4a98a66778
commit
cd9d093f60
@@ -8,18 +8,8 @@ client = TestClient(app)
|
||||
def test_get_validation_error():
|
||||
response = client.get("/items/foo")
|
||||
assert response.status_code == 400, response.text
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
assert (
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
"path -> item_id" in response.text
|
||||
or "'loc': ('path', 'item_id')" in response.text
|
||||
)
|
||||
assert (
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
"value is not a valid integer" in response.text
|
||||
or "Input should be a valid integer, unable to parse string as an integer"
|
||||
in response.text
|
||||
)
|
||||
assert "Validation errors:" in response.text
|
||||
assert "Field: ('path', 'item_id')" in response.text
|
||||
|
||||
|
||||
def test_get_http_error():
|
||||
|
||||
Reference in New Issue
Block a user