Skip to content

Commit 7ebc6fa

Browse files
committed
Fix search repository test
Signed off by joe@basicmemory.com Signed-off-by: Joe P <joe@basicmemory.com>
1 parent cfeac7d commit 7ebc6fa

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/repository/test_search_repository_edit_bug_fix.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ async def test_index_item_respects_project_isolation_during_edit():
4242
causing notes to disappear from the search index.
4343
"""
4444
from basic_memory import db
45+
from basic_memory.models.base import Base
4546
from basic_memory.repository.search_repository import SearchRepository
4647
from sqlalchemy.ext.asyncio import create_async_engine, async_sessionmaker
4748

@@ -51,7 +52,7 @@ async def test_index_item_respects_project_isolation_during_edit():
5152

5253
# Create the database schema
5354
async with engine.begin() as conn:
54-
await conn.run_sync(db.Base.metadata.create_all)
55+
await conn.run_sync(Base.metadata.create_all)
5556

5657
# Create two projects
5758
async with db.scoped_session(session_maker) as session:
@@ -178,6 +179,7 @@ async def test_index_item_respects_project_isolation_during_edit():
178179
async def test_index_item_updates_existing_record_same_project():
179180
"""Test that index_item() correctly updates existing records within the same project."""
180181
from basic_memory import db
182+
from basic_memory.models.base import Base
181183
from basic_memory.repository.search_repository import SearchRepository
182184
from sqlalchemy.ext.asyncio import create_async_engine, async_sessionmaker
183185

@@ -187,7 +189,7 @@ async def test_index_item_updates_existing_record_same_project():
187189

188190
# Create the database schema
189191
async with engine.begin() as conn:
190-
await conn.run_sync(db.Base.metadata.create_all)
192+
await conn.run_sync(Base.metadata.create_all)
191193

192194
# Create one project
193195
async with db.scoped_session(session_maker) as session:

0 commit comments

Comments
 (0)