fix: 让依赖当前日期的测试使用固定时间
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user