Skip to content

Commit 68d9660

Browse files
jope-bmclaude
andcommitted
fix: Update search service test to use timezone-aware datetime comparison
The test_after_date test was comparing timezone-naive datetime(2020, 1, 1) with timezone-aware search results, causing a TypeError. Fixed by making both past_date and future_date timezone-aware using .astimezone() for consistent comparison with search result timestamps. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Joe P <joe@basicmemory.com>
1 parent 999670f commit 68d9660

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/services/test_search_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ async def test_after_date(search_service, test_graph):
155155
"""Test search filters."""
156156

157157
# Should find with past date
158-
past_date = datetime(2020, 1, 1)
158+
past_date = datetime(2020, 1, 1).astimezone()
159159
results = await search_service.search(
160160
SearchQuery(
161161
text="entity",
@@ -166,7 +166,7 @@ async def test_after_date(search_service, test_graph):
166166
assert datetime.fromisoformat(r.created_at) > past_date
167167

168168
# Should not find with future date
169-
future_date = datetime(2030, 1, 1)
169+
future_date = datetime(2030, 1, 1).astimezone()
170170
results = await search_service.search(
171171
SearchQuery(
172172
text="entity",

0 commit comments

Comments
 (0)