18 lines
587 B
Python
18 lines
587 B
Python
from __future__ import annotations
|
|||
|
|
|
||
|
|
import pytest
|
||
|
|
|
||
|
|
from app.core.config import get_settings
|
||
|
|
|
||
|
|
|
||
|
|
@pytest.fixture(autouse=True)
|
||
|
|
def isolate_offsite_runtime_settings(monkeypatch: pytest.MonkeyPatch) -> None:
|
||
|
|
"""让集成测试使用固定角色,不受本机真实邮箱配置影响。"""
|
||
|
|
settings = get_settings().model_copy(
|
||
|
|
update={
|
||
|
|
"offsite_allowed_senders": ("15008108550@163.com",),
|
||
|
|
"offsite_mail_return_receiver": "15008108550@163.com",
|
||
|
|
}
|
||
|
|
)
|
||
|
|
monkeypatch.setattr("app.service.offsite_fund_service.get_settings", lambda: settings)
|