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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user