test: a reader's zone comes from their account; a London expiry reads BST or GMT (#6350)
The change-form test set the zone on the session, which the auth middleware resets from the account on every request. The password reset test asserted BST, which stopped being London's zone name on 25 Oct. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user