MCPcopy Create free account
hub / github.com/0010aor/FlashNotes / user_authentication_headers

Function user_authentication_headers

backend/tests/utils/user.py:11–20  ·  view source on GitHub ↗
(
    *, client: TestClient, email: str, password: str
)

Source from the content-addressed store, hash-verified

9
10
11def user_authentication_headers(
12 *, client: TestClient, email: str, password: str
13) -> dict[str, str]:
14 data = {"username": email, "password": password}
15
16 r = client.post(f"{settings.API_V1_STR}/tokens", data=data)
17 response = r.json()
18 auth_token = response["access_token"]
19 headers = {"Authorization": f"Bearer {auth_token}"}
20 return headers
21
22
23def create_random_user(db: Session) -> User:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected