fix(time): report Beijing wall clock independently of server timezone
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from relay import work_client
|
||||
|
||||
|
||||
def test_legacy_status_is_beijing_even_on_utc_host(monkeypatch):
|
||||
class Clock:
|
||||
@staticmethod
|
||||
def now(tz=None):
|
||||
instant=datetime(2026,11,5,17,30,tzinfo=timezone.utc)
|
||||
return instant.astimezone(tz) if tz else instant
|
||||
monkeypatch.setattr(work_client,'datetime',Clock)
|
||||
client=object.__new__(work_client.WorkClient)
|
||||
client.owner='synthetic-owner'
|
||||
client.access_token=lambda:'synthetic-token'
|
||||
result=client.status()
|
||||
assert result['local_time']=='2026-11-06T01:30:00+08:00'
|
||||
assert 'synthetic-token' not in str(result)
|
||||
Reference in New Issue
Block a user