Home / Function/ test_strict_login_incorrect_grant_type() — fastapi Function Reference

test_strict_login_incorrect_grant_type() — fastapi Function Reference

Architecture documentation for the test_strict_login_incorrect_grant_type() function in test_security_oauth2_optional.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  0038a19d_bea5_cb71_b83b_0fdcc36239bf["test_strict_login_incorrect_grant_type()"]
  efcf9068_9c64_9327_7595_bfad37430bf7["test_security_oauth2_optional.py"]
  0038a19d_bea5_cb71_b83b_0fdcc36239bf -->|defined in| efcf9068_9c64_9327_7595_bfad37430bf7
  style 0038a19d_bea5_cb71_b83b_0fdcc36239bf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_security_oauth2_optional.py lines 117–133

def test_strict_login_incorrect_grant_type(grant_type: str):
    response = client.post(
        "/login",
        data={"username": "johndoe", "password": "secret", "grant_type": grant_type},
    )
    assert response.status_code == 422
    assert response.json() == {
        "detail": [
            {
                "type": "string_pattern_mismatch",
                "loc": ["body", "grant_type"],
                "msg": "String should match pattern '^password$'",
                "input": grant_type,
                "ctx": {"pattern": "^password$"},
            }
        ]
    }

Domain

Subdomains

Frequently Asked Questions

What does test_strict_login_incorrect_grant_type() do?
test_strict_login_incorrect_grant_type() is a function in the fastapi codebase, defined in tests/test_security_oauth2_optional.py.
Where is test_strict_login_incorrect_grant_type() defined?
test_strict_login_incorrect_grant_type() is defined in tests/test_security_oauth2_optional.py at line 117.

Analyze Your Own Codebase

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

Try Supermodel Free