diff --git a/tests/integration/test_passwords.py b/tests/integration/test_passwords.py index 477c47a..2c8ba57 100644 --- a/tests/integration/test_passwords.py +++ b/tests/integration/test_passwords.py @@ -162,7 +162,8 @@ def test_a_forgotten_password_is_reset_from_the_emailed_link(app, monkeypatch): mine = to(sent, f"{name}@example.com", f"{sso_name}@example.com", f"nobody-{uid[:8]}@example.com") assert [m["To"] for m in mine] == [f"{name}@example.com"] text = mine[0].get_body(("plain",)).get_content() - assert name in text and "BST" in text + # In the account's zone, not UTC: London's name for it, summer or winter. + assert name in text and re.search(r"\d\d:\d\d (BST|GMT)\b", text) key = _KEY.search(text).group(1) page = await (await guest.get(f"/reset/{key}")).get_data(as_text=True) diff --git a/tests/integration/test_timeline_changes.py b/tests/integration/test_timeline_changes.py index 146540d..a8a176d 100644 --- a/tests/integration/test_timeline_changes.py +++ b/tests/integration/test_timeline_changes.py @@ -29,12 +29,13 @@ async def _user(app, name: str, role: str, tz: str | None = None): uid = str(uuid.uuid4()) async with app.db_sessionmaker() as s: async with s.begin(): + # The session takes its zone from the account on every request. s.add(User(id=uid, username=name, email=f"{name}@test", password_hash="x", - role=UserRole(role), is_active=True)) + role=UserRole(role), is_active=True, time_zone=tz)) client = app.test_client() async with client.session_transaction() as sess: sess.update(user_id=uid, user_role=role, username=name, _csrf="test-token", login_at=time.time(), - **({"tz": tz} if tz else {})) + tz=tz) return client, uid