def METHOD_NAME(monkeypatch):
    # given
    img_data = BytesIO()
    image = Image.new("RGB", size=(1, 1))
    image.save(img_data, format="JPEG")
    field = "image"
    error_msg = "Test syntax error"
    image_file_mock = Mock(side_effect=SyntaxError(error_msg))
    monkeypatch.setattr(
        "saleor.graphql.core.validators.file._validate_image_exif", image_file_mock
    )
    img = SimpleUploadedFile("product.jpg", img_data.getvalue(), "image/jpeg")
    # when
    with pytest.raises(ValidationError) as exc:
        clean_image_file({field: img}, field, ProductErrorCode)
    # then
    assert error_msg in exc.value.args[0][field].message