(
*, client: TestClient, email: str, password: str
)
| 9 | |
| 10 | |
| 11 | def 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 | |
| 23 | def create_random_user(db: Session) -> User: |
no outgoing calls
no test coverage detected