blitz_api/tests/utils.py

11 lines
326 B
Python
Raw Normal View History

from fastapi.security import HTTPAuthorizationCredentials
from app.auth.auth_bearer import JWTBearer
def monkeypatch_auth(monkeypatch):
async def fake__call__(self, request):
return HTTPAuthorizationCredentials(scheme="Bearer", credentials="creds")
monkeypatch.setattr(JWTBearer, "__call__", fake__call__)