fix(fc3k): add origin=imported_filesystem to test ImageRecord ctors (second NOT NULL column after mime)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-25 01:28:54 -04:00
parent a0136fa30d
commit 832345a245
3 changed files with 8 additions and 0 deletions
+5
View File
@@ -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)
+1
View File
@@ -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)
+2
View File
@@ -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()