1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-21 14:19:41 +02:00
mealie/tests/utils/user_login.py

13 lines
349 B
Python
Raw Normal View History

import json
from fastapi.testclient import TestClient
from tests.utils import api_routes
def login(form_data, api_client: TestClient):
response = api_client.post(api_routes.auth_token, form_data)
assert response.status_code == 200
token = json.loads(response.text).get("access_token")
return {"Authorization": f"Bearer {token}"}