From 8bbab7e92bf3b2e33d2cb0a428bcfb65a525691d Mon Sep 17 00:00:00 2001 From: snowy-yang <102860110+snowy-yang@users.noreply.github.com> Date: Thu, 24 Sep 2026 19:49:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=9B=9E=E5=BF=86=E6=9D=80?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=EF=BC=9Adays=3D1=20=E8=A6=86=E7=9B=96?= =?UTF-8?q?=E6=9C=80=E8=BF=9124=E5=B0=8F=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_db_pg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_db_pg.py b/tests/test_db_pg.py index 01b9d88..32117d6 100644 --- a/tests/test_db_pg.py +++ b/tests/test_db_pg.py @@ -141,6 +141,6 @@ async def test_memory_from_days_ago(conn): await db.add_message(s, "user", "半个月前的话") rows = await db.memory_from_days_ago(s, 15, time.time()) assert rows == [] # 刚插入的不在 15 天前 - # days=0 的窗口是 [now_ts, now_ts+86400],now_ts 用现在即可罩住刚插入的 - rows = await db.memory_from_days_ago(s, 0, time.time()) + # days=1 的窗口是 [now-86400, now],正好罩住刚插入的消息 + rows = await db.memory_from_days_ago(s, 1, time.time()) assert any(r["content"] == "半个月前的话" for r in rows)