Home / Function/ test_post_with_only_name_price() — fastapi Function Reference

test_post_with_only_name_price() — fastapi Function Reference

Architecture documentation for the test_post_with_only_name_price() function in test_tutorial001.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  fd4be95e_b5c0_aeac_3c80_85773eeba562["test_post_with_only_name_price()"]
  384ebf37_bf33_dd11_7410_101f39082f41["test_tutorial001.py"]
  fd4be95e_b5c0_aeac_3c80_85773eeba562 -->|defined in| 384ebf37_bf33_dd11_7410_101f39082f41
  style fd4be95e_b5c0_aeac_3c80_85773eeba562 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_body/test_tutorial001.py lines 89–101

def test_post_with_only_name_price(client: TestClient):
    response = client.post("/items/", json={"name": "Foo", "price": "twenty"})
    assert response.status_code == 422
    assert response.json() == {
        "detail": [
            {
                "type": "float_parsing",
                "loc": ["body", "price"],
                "msg": "Input should be a valid number, unable to parse string as a number",
                "input": "twenty",
            }
        ]
    }

Domain

Subdomains

Frequently Asked Questions

What does test_post_with_only_name_price() do?
test_post_with_only_name_price() is a function in the fastapi codebase, defined in tests/test_tutorial/test_body/test_tutorial001.py.
Where is test_post_with_only_name_price() defined?
test_post_with_only_name_price() is defined in tests/test_tutorial/test_body/test_tutorial001.py at line 89.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free