Home / Function/ test_login() — fastapi Function Reference

test_login() — fastapi Function Reference

Architecture documentation for the test_login() function in test_tutorial004.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  b06041f1_2b12_986a_d52d_193eb4c44a41["test_login()"]
  99a6e52c_39c3_5825_2899_8b0fa980bff4["test_tutorial004.py"]
  b06041f1_2b12_986a_d52d_193eb4c44a41 -->|defined in| 99a6e52c_39c3_5825_2899_8b0fa980bff4
  style b06041f1_2b12_986a_d52d_193eb4c44a41 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_security/test_tutorial004.py lines 35–41

def test_login(mod: ModuleType):
    client = TestClient(mod.app)
    response = client.post("/token", data={"username": "johndoe", "password": "secret"})
    assert response.status_code == 200, response.text
    content = response.json()
    assert "access_token" in content
    assert content["token_type"] == "bearer"

Domain

Subdomains

Frequently Asked Questions

What does test_login() do?
test_login() is a function in the fastapi codebase, defined in tests/test_tutorial/test_security/test_tutorial004.py.
Where is test_login() defined?
test_login() is defined in tests/test_tutorial/test_security/test_tutorial004.py at line 35.

Analyze Your Own Codebase

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

Try Supermodel Free