- Sort Score
- Num 10 results
- Language All
Results 1 - 2 of 2 for price_with_tax (0.13 seconds)
-
docs_src/body/tutorial002_py310.py
app = FastAPI() @app.post("/items/") async def create_item(item: Item): item_dict = item.model_dump() if item.tax is not None: price_with_tax = item.price + item.tax item_dict.update({"price_with_tax": price_with_tax})
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Dec 20 15:55:38 GMT 2025 - 447 bytes - Click Count (0) -
tests/test_tutorial/test_body/test_tutorial002.py
) assert response.status_code == 200 assert response.json() == { "name": "Foo", "price": 50.5, "description": "Some Foo", "tax": 0.3, "price_with_tax": 50.8, } @pytest.mark.parametrize("price", ["50.5", 50.5]) def test_post_without_tax(client: TestClient, price: str | float): response = client.post(Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 5.8K bytes - Click Count (0)