fix: 让依赖当前日期的测试使用固定时间

This commit is contained in:
2026-11-16 02:29:50 +08:00
parent 5dd221236b
commit 5e5f3bd1bd
2 changed files with 30 additions and 5 deletions
+3 -2
View File
@@ -395,12 +395,13 @@ def test_study_window_clamps_missing_day() -> None:
def test_immediate_start_skips_monthly_window() -> None:
frozen = datetime(2026, 11, 15, 12, 0, tzinfo=CN_TZ)
account = _Start(28, 23, 59, 59)
assert study_eligible(account) is False
assert study_eligible(account, frozen) is False
start_now(account)
assert account.study_paused is False
assert account.study_ignore_window is True
assert study_eligible(account) is True
assert study_eligible(account, frozen) is True
stop_now(account, datetime(2026, 11, 15, 12, 0, tzinfo=CN_TZ))
assert account.study_paused is True
assert account.study_stop_month == "2026-11"