Home / Function/ test_token_inactive_user() — fastapi Function Reference

test_token_inactive_user() — fastapi Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  f1a431e4_c9aa_2604_ba66_2fa1213b81ae["test_token_inactive_user()"]
  99a6e52c_39c3_5825_2899_8b0fa980bff4["test_tutorial004.py"]
  f1a431e4_c9aa_2604_ba66_2fa1213b81ae -->|defined in| 99a6e52c_39c3_5825_2899_8b0fa980bff4
  193c5ee6_1e90_d94f_c640_7dfbaa4c2bab["get_access_token()"]
  f1a431e4_c9aa_2604_ba66_2fa1213b81ae -->|calls| 193c5ee6_1e90_d94f_c640_7dfbaa4c2bab
  style f1a431e4_c9aa_2604_ba66_2fa1213b81ae fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_security/test_tutorial004.py lines 158–175

def test_token_inactive_user(mod: ModuleType):
    client = TestClient(mod.app)
    alice_user_data = {
        "username": "alice",
        "full_name": "Alice Wonderson",
        "email": "alice@example.com",
        "hashed_password": mod.get_password_hash("secretalice"),
        "disabled": True,
    }
    with patch.dict(f"{mod.__name__}.fake_users_db", {"alice": alice_user_data}):
        access_token = get_access_token(
            username="alice", password="secretalice", client=client
        )
        response = client.get(
            "/users/me", headers={"Authorization": f"Bearer {access_token}"}
        )
    assert response.status_code == 400, response.text
    assert response.json() == {"detail": "Inactive user"}

Domain

Subdomains

Frequently Asked Questions

What does test_token_inactive_user() do?
test_token_inactive_user() is a function in the fastapi codebase, defined in tests/test_tutorial/test_security/test_tutorial004.py.
Where is test_token_inactive_user() defined?
test_token_inactive_user() is defined in tests/test_tutorial/test_security/test_tutorial004.py at line 158.
What does test_token_inactive_user() call?
test_token_inactive_user() calls 1 function(s): get_access_token.

Analyze Your Own Codebase

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

Try Supermodel Free