This commit is contained in:
@@ -97,7 +97,7 @@ class TestOAuthFunctional:
|
||||
body = response.body
|
||||
if isinstance(body, memoryview):
|
||||
body = bytes(body)
|
||||
assert b"Invalid or expired OAuth state" in body
|
||||
assert b"oauth_state_expired" in body # 🔍 Проверяем новый формат ошибки
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_oauth_callback_success_session_free(self):
|
||||
@@ -163,8 +163,11 @@ class TestOAuthFunctional:
|
||||
assert isinstance(response, RedirectResponse)
|
||||
assert response.status_code == 307
|
||||
|
||||
# Проверяем URL редиректа
|
||||
assert response.headers["location"] == "https://localhost:3000"
|
||||
# Проверяем URL редиректа (теперь с параметрами)
|
||||
redirect_url = response.headers["location"]
|
||||
assert redirect_url.startswith("https://localhost:3000")
|
||||
assert "access_token=" in redirect_url # 🔍 Проверяем наличие токена
|
||||
assert "state=valid_state" in redirect_url # 🔍 Проверяем state
|
||||
|
||||
# Проверяем что токен получен без использования request.session
|
||||
mock_client.fetch_access_token.assert_called_once_with(
|
||||
|
||||
Reference in New Issue
Block a user