10000 🐛 Check Content-Type request header before assuming JSON by patrickkwang · Pull Request #2118 · fastapi/fastapi · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix broken-body test
  • Loading branch information
Patrick Wang authored and patrickkwang committed Apr 10, 2021
commit 4e8605e5bf2c32082c7292be92838532d734d29b
13 changes: 3 additions & 10 deletions tests/test_tutorial/test_body/test_tutorial001.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,9 @@ def test_post_broken_body():
assert response.json() == {
"detail": [
{
"ctx": {
"colno": 1,
"doc": "name=Foo&price=50.5",
"lineno": 1,
"msg": "Expecting value",
"pos": 0,
},
"loc": ["body", 0],
"msg": "Expecting value: line 1 column 1 (char 0)",
"type": "value_error.jsondecode",
"loc": ["body"],
"msg": "value is not a valid dict",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be considered a breaking change. Think even my work API has a test similar to this.

"type": "type_error.dict",
}
]
}
Expand Down
0