def METHOD_NAME(
    api_client, checkout_with_problems, product_with_single_variant
):
    # given
    channel = checkout_with_problems.channel
    channel.use_legacy_error_flow_for_checkout = False
    channel.save(update_fields=["use_legacy_error_flow_for_checkout"])
    variant = product_with_single_variant.variants.first()
    checkout_info = fetch_checkout_info(
        checkout_with_problems, [], get_plugins_manager()
    )
    add_variant_to_checkout(checkout_info, variant, 1)
    line = checkout_info.checkout.lines.last()
    variables = {
        "id": to_global_id_or_none(checkout_with_problems),
        "lineId": to_global_id_or_none(line),
    }
    # when
    response = api_client.post_graphql(
        MUTATION_CHECKOUT_LINE_DELETE,
        variables,
    )
    content = get_graphql_content(response)
    # then
    assert not content["data"]["checkoutLineDelete"]["errors"]