We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d122f7 commit 71d90aaCopy full SHA for 71d90aa
2 files changed
app/exception handlers/__init__.py
tests/api/test_stuff.py
@@ -25,9 +25,15 @@ async def test_add_stuff(client: AsyncClient):
25
"description": stuff["description"],
26
}
27
)
28
+ response = await client.post("/stuff", json=stuff)
29
+ assert response.status_code == status.HTTP_500_INTERNAL_SERVER_ERROR
30
+ assert response.json() == snapshot({'message':'A database error occurred. Please try again later.'})
31
32
33
async def test_get_stuff(client: AsyncClient):
34
+ response = await client.get(f"/stuff/nonexistent")
35
+ assert response.status_code == status.HTTP_404_NOT_FOUND
36
+ assert response.json() == snapshot({'no_response':'The requested resource was not found'})
37
stuff = StuffFactory.build(factory_use_constructors=True).model_dump(mode="json")
38
await client.post("/stuff", json=stuff)
39
name = stuff["name"]
0 commit comments