diff --git a/tests/test_energy_cost.py b/tests/test_energy_cost.py index 9f75d65..6da29e6 100644 --- a/tests/test_energy_cost.py +++ b/tests/test_energy_cost.py @@ -1263,6 +1263,9 @@ class TestSummarizePrincipleC: def test_future_window_counts_0_days(self, energy_db: Session) -> None: """A fully future window (all local dates > today) counts 0 days. + Pins ``local_now`` to June 25 2026 noon AMS so the 7/1→8/1 window is + genuinely in the future regardless of the actual wall-clock date + (mirrors the sibling window tests, which all pin ``local_now``). Matches table row: 7/1→8/1 (all future) → 0 days. """ eff_utc = _ams_midnight(2026, 6, 1) @@ -1270,7 +1273,9 @@ class TestSummarizePrincipleC: start = _ams_midnight(2026, 7, 1) end = _ams_midnight(2026, 8, 1) - result = self._run_summarize_ams(energy_db, start, end) + # Pin local_now to June 25 2026 noon AMS so 7/1→8/1 stays fully future. + pinned_now = datetime(2026, 6, 25, 12, 0, 0, tzinfo=_ams()) + result = self._run_summarize_ams(energy_db, start, end, pinned_now=pinned_now) assert result["fixed_costs"] == 0.0, ( f"All-future window must count 0 days; got fixed_costs={result['fixed_costs']}"