Making text search apply to both description and sku in imported parts and augmented parts

This commit is contained in:
Ian Roddis committed 2026-08-17 16:05:01 -03:00
1 parent 292830ae0f
commit ce2bdc43a8
7 files changed
+53 -30

No files matched your search

+34
View File
@@ -90,6 +90,23 @@ async def test_augmented_parts_filter_sorts_by_sku_asc(
]
@pytest.mark.asyncio
async def test_augmented_parts_filter_matches_by_sku(
client, seeded, make_user, db_sessionmaker
):
async with db_sessionmaker() as db:
await _seed_augmented_parts(db)
await make_user("reader2b@example.com", role_ids=[seeded["roles"]["user"].id])
await _web_login(client, "reader2b@example.com")
resp = await client.get("/admin/augmented-parts/filter?description=SKU-B")
assert resp.status_code == 200
body = resp.text
assert "Charlie scope" in body
assert "Alpha scope" not in body
assert "Bravo scope" not in body
@pytest.mark.asyncio
async def test_imported_parts_page_sorts_by_description_desc(
client, seeded, make_user, db_sessionmaker
@@ -109,6 +126,23 @@ async def test_imported_parts_page_sorts_by_description_desc(
]
@pytest.mark.asyncio
async def test_imported_parts_filter_matches_by_inventory_id(
client, seeded, make_user, db_sessionmaker
):
async with db_sessionmaker() as db:
await _seed_imported_parts(db)
await make_user("reader4@example.com", role_ids=[seeded["roles"]["user"].id])
await _web_login(client, "reader4@example.com")
resp = await client.get("/admin/imported-parts/filter?description=INV-3")
assert resp.status_code == 200
body = resp.text
assert "Bravo widget" in body
assert "Alpha widget" not in body
assert "Charlie widget" not in body
@pytest.mark.asyncio
async def test_list_filtered_sorts_by_joined_colour_name(db_sessionmaker):
async with db_sessionmaker() as db: