fix(fc-cleanup): test sha256 fixtures stay within varchar(64) + isort the registration import — Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

This commit is contained in:
2026-05-26 01:32:50 -04:00
parent 6ed2021ad6
commit 2d4bfa4375
2 changed files with 10 additions and 5 deletions
+4 -1
View File
@@ -28,9 +28,12 @@ def _make_image_record(db_sync, tmp_path, *, width, height, color):
and insert an ImageRecord row with all required NOT-NULL columns set."""
path = tmp_path / f"img_{width}x{height}_{color[0]}.png"
Image.new("RGB", (width, height), color).save(path)
# sha256 column is varchar(64) — use a deterministic 64-char pseudo
# hash built from the unique inputs.
sha = f"{width:04d}{height:04d}{color[0]:03d}".ljust(64, "0")[:64]
rec = ImageRecord(
path=str(path),
sha256=f"fake-{width}-{height}-{color[0]:03d}" + "0" * 50,
sha256=sha,
size_bytes=path.stat().st_size,
mime="image/png", # reference-image-record-required-columns
width=width,