tests logout

This commit is contained in:
2026-07-29 18:32:22 +03:00
parent 00403191f5
commit f87f54de55
4 changed files with 136 additions and 23 deletions

View File

@@ -1,7 +1,8 @@
import pytest
from fastapi import Request
from src.service.auth.auth import CurrentUser
from src.service.auth.jwt import Jwt
from src.service.auth.jwt import Hashes, Jwt
@pytest.fixture
@@ -12,4 +13,15 @@ def current_user_service()->CurrentUser:
@pytest.fixture
def jwt_service()->Jwt:
jwt_service=Jwt()
return jwt_service
return jwt_service
@pytest.fixture
def hash_service()->Hashes:
hash_service=Hashes()
return hash_service
@pytest.fixture
def requests(mocker):
fake_request = mocker.MagicMock(spec=Request)
fake_request.headers = {"user-agent": "pytest-agent", "x-forwarded-for":"127.0.0.1"}
return fake_request