Home / Function/ test_model_optional_str_missing() — fastapi Function Reference

test_model_optional_str_missing() — fastapi Function Reference

Architecture documentation for the test_model_optional_str_missing() function in test_optional_str.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  7af858b3_8d4b_50f6_bda6_5b799d15ed05["test_model_optional_str_missing()"]
  3f7d416c_ad03_437e_1805_be947abbd565["test_optional_str.py"]
  7af858b3_8d4b_50f6_bda6_5b799d15ed05 -->|defined in| 3f7d416c_ad03_437e_1805_be947abbd565
  style 7af858b3_8d4b_50f6_bda6_5b799d15ed05 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_request_params/test_body/test_optional_str.py lines 57–70

def test_model_optional_str_missing():
    client = TestClient(app)
    response = client.post("/model-optional-str")
    assert response.status_code == 422, response.text
    assert response.json() == {
        "detail": [
            {
                "input": None,
                "loc": ["body"],
                "msg": "Field required",
                "type": "missing",
            },
        ],
    }

Domain

Subdomains

Frequently Asked Questions

What does test_model_optional_str_missing() do?
test_model_optional_str_missing() is a function in the fastapi codebase, defined in tests/test_request_params/test_body/test_optional_str.py.
Where is test_model_optional_str_missing() defined?
test_model_optional_str_missing() is defined in tests/test_request_params/test_body/test_optional_str.py at line 57.

Analyze Your Own Codebase

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

Try Supermodel Free