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_description.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  ec7b3523_cdaf_60c7_4b67_3888f5e114eb["test_strict_login_incorrect_grant_type()"]
  7e784b87_9cdf_528d_4ae2_09349aaf6e83["test_security_oauth2_optional_description.py"]
  ec7b3523_cdaf_60c7_4b67_3888f5e114eb -->|defined in| 7e784b87_9cdf_528d_4ae2_09349aaf6e83
  style ec7b3523_cdaf_60c7_4b67_3888f5e114eb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_security_oauth2_optional_description.py lines 118–134

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_description.py.
Where is test_strict_login_incorrect_grant_type() defined?
test_strict_login_incorrect_grant_type() is defined in tests/test_security_oauth2_optional_description.py at line 118.

Analyze Your Own Codebase

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

Try Supermodel Free