Home / Function/ test_post_body_extra_form() — fastapi Function Reference

test_post_body_extra_form() — fastapi Function Reference

Architecture documentation for the test_post_body_extra_form() function in test_tutorial002.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  52711eb9_791a_258f_1f4a_279d4575d2c1["test_post_body_extra_form()"]
  6fa7bef8_d1fa_4291_dad4_4d0073156a79["test_tutorial002.py"]
  52711eb9_791a_258f_1f4a_279d4575d2c1 -->|defined in| 6fa7bef8_d1fa_4291_dad4_4d0073156a79
  style 52711eb9_791a_258f_1f4a_279d4575d2c1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_request_form_models/test_tutorial002.py lines 28–42

def test_post_body_extra_form(client: TestClient):
    response = client.post(
        "/login/", data={"username": "Foo", "password": "secret", "extra": "extra"}
    )
    assert response.status_code == 422
    assert response.json() == {
        "detail": [
            {
                "type": "extra_forbidden",
                "loc": ["body", "extra"],
                "msg": "Extra inputs are not permitted",
                "input": "extra",
            }
        ]
    }

Domain

Subdomains

Frequently Asked Questions

What does test_post_body_extra_form() do?
test_post_body_extra_form() is a function in the fastapi codebase, defined in tests/test_tutorial/test_request_form_models/test_tutorial002.py.
Where is test_post_body_extra_form() defined?
test_post_body_extra_form() is defined in tests/test_tutorial/test_request_form_models/test_tutorial002.py at line 28.

Analyze Your Own Codebase

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

Try Supermodel Free