def METHOD_NAME(
    staff_api_client, permission_manage_orders, draft_order
):
    # given
    order = draft_order
    order.status = OrderStatus.DRAFT
    order.save(update_fields=["status"])
    line = order.lines.first()
    product = line.variant.product
    product.channel_listings.update(available_for_purchase_at=None)
    order_id = graphene.Node.to_global_id("Order", order.id)
    variables = {"id": order_id}
    staff_api_client.user.user_permissions.add(permission_manage_orders)
    # when
    response = staff_api_client.post_graphql(ORDER_CAN_FINALIZE_QUERY, variables)
    content = get_graphql_content(response)
    # then
    assert content["data"]["order"]["canFinalize"] is False
    errors = content["data"]["order"]["errors"]
    assert len(errors) == 1
    assert errors[0]["code"] == OrderErrorCode.PRODUCT_UNAVAILABLE_FOR_PURCHASE.name
    assert errors[0]["field"] == "lines"
    assert errors[0]["orderLines"] == [graphene.Node.to_global_id("OrderLine", line.pk)]