From 02bcd3c2a78a7628ba0a7f4c49ffa1ecc9e2cda9 Mon Sep 17 00:00:00 2001 From: Sandy Spicer Date: Thu, 1 Oct 2026 23:42:01 -0700 Subject: [PATCH 1/2] chore(today): pin the clock in the first-open briefing test The test opens the briefing once with a Prague timezone and once with the project's UTC, and expects the same briefing. A briefing day starts at eight local time, so between 06:00 and 08:00 UTC the two calls fall on different days and the test fails for every pull request. Co-Authored-By: Claude Fable 5.1 --- products/today/backend/tests/test_api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/products/today/backend/tests/test_api.py b/products/today/backend/tests/test_api.py index c26f4074cd4c..9a067b85bf2e 100644 --- a/products/today/backend/tests/test_api.py +++ b/products/today/backend/tests/test_api.py @@ -47,7 +47,8 @@ def test_no_briefing_and_no_row_for_people_who_may_not_get_one( def test_first_open_creates_one_briefing_and_starts_generation_once(self, sync_connect: MagicMock) -> None: sync_connect.return_value.start_workflow = AsyncMock() - with self._flag(True): + # At noon UTC it is past eight in Prague and in the project's UTC, so both calls read the same briefing day. + with self._flag(True), time_machine.travel(datetime(2026, 9, 30, 12, 0, tzinfo=UTC), tick=False): first = self.client.get(f"/api/projects/{self.team.id}/today/briefing/?timezone=Europe/Prague") # An MCP call sends no timezone; it must not move the person's mornings to the project's. second = self.client.get(f"/api/projects/{self.team.id}/today/briefing/") From 5b5a95b3b43d4dd4a59b999a0408d72e25008e1d Mon Sep 17 00:00:00 2001 From: Sandy Spicer Date: Thu, 1 Oct 2026 23:48:50 -0700 Subject: [PATCH 2/2] test(today): cover a call without a timezone on a different briefing day Between 06:00 and 08:00 UTC a call without a timezone reads the project's briefing day, which is the day before for a person in Prague. The day boundary test now asserts that at a pinned time. Co-Authored-By: Claude Fable 5.1 --- products/today/backend/tests/test_api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/products/today/backend/tests/test_api.py b/products/today/backend/tests/test_api.py index 9a067b85bf2e..90dcb806f399 100644 --- a/products/today/backend/tests/test_api.py +++ b/products/today/backend/tests/test_api.py @@ -88,10 +88,13 @@ def test_the_briefing_day_starts_at_eight(self, sync_connect: MagicMock) -> None early = self.client.get(url).json() with time_machine.travel(datetime(2026, 9, 30, 7, 0, tzinfo=UTC), tick=False): today = self.client.get(url).json() + # A call without a timezone uses the project's UTC, where it is still before eight. + without_timezone = self.client.get(f"/api/projects/{self.team.id}/today/briefing/").json() assert early["local_day"] == "2026-09-29" assert today["local_day"] == "2026-09-30" assert early["id"] != today["id"] + assert without_timezone["id"] == early["id"] assert sync_connect.return_value.start_workflow.call_count == 2 def test_a_refresh_while_one_is_being_written_starts_nothing_new(self, sync_connect: MagicMock) -> None: