diff --git a/tests/test_api_admin.py b/tests/test_api_admin.py index ce303ac..88df653 100644 --- a/tests/test_api_admin.py +++ b/tests/test_api_admin.py @@ -118,10 +118,12 @@ async def test_bulk_delete_dry_run_returns_counts(client, db, tmp_path): i1 = ImageRecord( artist_id=a.id, path=str(tmp_path / "1.jpg"), sha256="1" * 64, size_bytes=10, mime="image/jpeg", + origin="imported_filesystem", ) i2 = ImageRecord( artist_id=a.id, path=str(tmp_path / "2.jpg"), sha256="2" * 64, size_bytes=20, mime="image/jpeg", + origin="imported_filesystem", ) db.add_all([i1, i2]) await db.commit() @@ -170,6 +172,7 @@ async def test_bulk_delete_wrong_confirm_400_with_expected_token( img = ImageRecord( artist_id=a.id, path=str(tmp_path / "x.jpg"), sha256="c" * 64, size_bytes=10, mime="image/jpeg", + origin="imported_filesystem", ) db.add(img) await db.commit() @@ -197,6 +200,7 @@ async def test_bulk_delete_correct_confirm_dispatches( img = ImageRecord( artist_id=a.id, path=str(tmp_path / "x.jpg"), sha256="d" * 64, size_bytes=10, mime="image/jpeg", + origin="imported_filesystem", ) db.add(img) await db.commit() @@ -324,6 +328,7 @@ async def test_prune_unused_dry_run_lists_unused(client, db, tmp_path): img = ImageRecord( artist_id=a.id, path=str(tmp_path / "p.jpg"), sha256="e" * 64, size_bytes=10, mime="image/jpeg", + origin="imported_filesystem", ) db.add(img) used = Tag(name="kept", kind=TagKind.general) diff --git a/tests/test_cleanup_service.py b/tests/test_cleanup_service.py index f40113a..9e99e04 100644 --- a/tests/test_cleanup_service.py +++ b/tests/test_cleanup_service.py @@ -22,6 +22,7 @@ def _make_image(db_sync, *, artist, path, sha256, size=1000, thumb=None): sha256=sha256, size_bytes=size, mime="image/jpeg", + origin="imported_filesystem", thumbnail_path=thumb, ) db_sync.add(img) diff --git a/tests/test_tasks_admin.py b/tests/test_tasks_admin.py index 332cdd1..948dd39 100644 --- a/tests/test_tasks_admin.py +++ b/tests/test_tasks_admin.py @@ -60,6 +60,7 @@ async def test_delete_artist_cascade_task_removes_artist_and_records_ok( db_sync.add(ImageRecord( artist_id=a.id, path=str(f), sha256=f"{i:064x}", size_bytes=10, mime="image/jpeg", + origin="imported_filesystem", )) db_sync.commit() artist_id = a.id @@ -123,6 +124,7 @@ async def test_bulk_delete_images_task_removes_listed_images( img = ImageRecord( artist_id=a.id, path=str(f), sha256=f"a{i:063x}", size_bytes=10, mime="image/jpeg", + origin="imported_filesystem", ) db_sync.add(img) db_sync.flush()