Treat Mealie's "no image" sentinel as a missing cover
Mealie stores the literal string "no image" in the recipe's image field when there is no cover, so bool(recipe["image"]) reported a cover that is not there: the check meant to catch a missing image downgraded to a warning instead of failing. Observed on a recipe created through Mealie's own image import, which returned image: "no image". Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -61,6 +61,14 @@ class TestCoverImage:
|
||||
assert status_of(report, "cover_image") == "fail"
|
||||
assert report["complete"] is False
|
||||
|
||||
@pytest.mark.parametrize("stored", ["no image", "No Image", " no image ", ""])
|
||||
def test_mealies_no_image_sentinel_fails(self, stored):
|
||||
# Verified against Mealie 3.22: a recipe without a cover stores the
|
||||
# string "no image", which a truthiness test reads as a cover present.
|
||||
report = verify_recipe(complete_recipe(image=stored))
|
||||
assert status_of(report, "cover_image") == "fail"
|
||||
assert report["complete"] is False
|
||||
|
||||
|
||||
class TestSwedishContent:
|
||||
def test_english_ingredient_line_fails(self):
|
||||
|
||||
Reference in New Issue
Block a user