Add test for successful item creation in test_json_error_improvements.py

This commit is contained in:
Arif Dogan 2025-09-19 16:48:11 +02:00
parent 7a8da3a4ad
commit dc1321b0d0
No known key found for this signature in database
GPG Key ID: A2131177E83422CE
1 changed files with 13 additions and 0 deletions

View File

@ -139,3 +139,16 @@ def test_json_decode_error_in_middle_of_long_document():
assert error["input"].endswith("...")
assert "invalid" in error["input"]
assert error["type"] == "json_invalid"
def test_successful_item_creation():
response = client.post(
"/items/",
json={"name": "Test Item", "price": 19.99, "description": "A test item"},
)
assert response.status_code == 200
data = response.json()
assert data["name"] == "Test Item"
assert data["price"] == 19.99
assert data["description"] == "A test item"