initial commit
This commit is contained in:
17
tests/helpers/mocks.py
Normal file
17
tests/helpers/mocks.py
Normal file
@ -0,0 +1,17 @@
|
||||
from typing import Any
|
||||
|
||||
from fastapi.encoders import jsonable_encoder
|
||||
|
||||
from src.app import models
|
||||
from tests.conftest import fake
|
||||
|
||||
|
||||
def get_current_user(user: models.User) -> dict[str, Any]:
|
||||
return jsonable_encoder(user)
|
||||
|
||||
|
||||
def oauth2_scheme() -> str:
|
||||
token = fake.sha256()
|
||||
if isinstance(token, bytes):
|
||||
token = token.decode("utf-8")
|
||||
return token # type: ignore
|
||||
Reference in New Issue
Block a user