From 77943302f49c374570daddaf9909d14c6ead04b2 Mon Sep 17 00:00:00 2001 From: snowy-yang <102860110+snowy-yang@users.noreply.github.com> Date: Thu, 24 Sep 2026 19:45:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20test=5Fmemory=5Ffrom=5Fday?= =?UTF-8?q?s=5Fago=20=E7=9A=84=E7=AA=97=E5=8F=A3=E7=AE=97=E6=9C=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_db_pg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_db_pg.py b/tests/test_db_pg.py index 5ae5f31..01b9d88 100644 --- a/tests/test_db_pg.py +++ b/tests/test_db_pg.py @@ -141,5 +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 天前 - rows = await db.memory_from_days_ago(s, 0, time.time() + 86400) + # days=0 的窗口是 [now_ts, now_ts+86400],now_ts 用现在即可罩住刚插入的 + rows = await db.memory_from_days_ago(s, 0, time.time()) assert any(r["content"] == "半个月前的话" for r in rows)