def METHOD_NAME(
    moves,
    expected_order,
    staff_api_client,
    permission_manage_channels,
    channel_USD,
    warehouses,
    warehouse,
):
    # given
    channel_id = graphene.Node.to_global_id("Channel", channel_USD.pk)
    channel_warehouses = list(channel_USD.channelwarehouse.all())
    assert len(channel_warehouses) == 3
    channel_warehouse_1 = channel_warehouses[0]
    channel_warehouse_2 = channel_warehouses[1]
    channel_warehouse_3 = channel_warehouses[2]
    channel_warehouse_1.sort_order = 0
    channel_warehouse_2.sort_order = 1
    channel_warehouse_3.sort_order = 2
    ChannelWarehouse.objects.bulk_update(channel_warehouses, ["sort_order"])
    warehouse_1_id = graphene.Node.to_global_id(
        "Warehouse", channel_warehouse_1.warehouse_id
    )
    warehouse_2_id = graphene.Node.to_global_id(
        "Warehouse", channel_warehouse_2.warehouse_id
    )
    warehouse_3_id = graphene.Node.to_global_id(
        "Warehouse", channel_warehouse_3.warehouse_id
    )
    warehouses = [warehouse_1_id, warehouse_2_id, warehouse_3_id]
    variables = {
        "channelId": channel_id,
        "moves": [
            {"id": warehouses[index], "sortOrder": move} for index, move in moves
        ],
    }
    # when
    response = staff_api_client.post_graphql(
        CHANNEL_REORDER_WAREHOUSES, variables, permissions=[permission_manage_channels]
    )
    # then
    content = get_graphql_content(response)
    data = content["data"]["channelReorderWarehouses"]
    errors = data["errors"]
    assert not errors
    assert len(data["channel"]["warehouses"]) == 3
    expected_order = [warehouses[index] for index in expected_order]
    assert [
        warehouse_data["id"] for warehouse_data in data["channel"]["warehouses"]
    ] == expected_order