core/tests/auth/conftest.py

25 lines
808 B
Python
Raw Normal View History

2025-05-29 09:37:39 +00:00
import pytest
2025-05-16 06:11:39 +00:00
@pytest.fixture
def oauth_settings() -> dict[str, dict[str, str]]:
2025-05-16 06:11:39 +00:00
"""Тестовые настройки OAuth"""
return {
"GOOGLE": {"id": "test_google_id", "key": "test_google_secret"},
"GITHUB": {"id": "test_github_id", "key": "test_github_secret"},
"FACEBOOK": {"id": "test_facebook_id", "key": "test_facebook_secret"},
}
@pytest.fixture
def frontend_url() -> str:
"""URL фронтенда для тестов"""
2025-05-16 06:22:53 +00:00
return "https://localhost:3000"
2025-05-16 06:11:39 +00:00
@pytest.fixture(autouse=True)
def mock_settings(monkeypatch, oauth_settings, frontend_url):
"""Подменяем настройки для тестов"""
monkeypatch.setattr("auth.oauth.OAUTH_CLIENTS", oauth_settings)
monkeypatch.setattr("auth.oauth.FRONTEND_URL", frontend_url)