def METHOD_NAME(client, holding_lib_martigny, item_lib_martigny,
                            item_lib_martigny_data, document,
                            item_type_on_site_martigny, loc_public_martigny,
                            item_lib_saxon_data, loc_public_saxon,
                            item_type_standard_martigny):
    """Test holding and item links."""
    item = deepcopy(item_lib_martigny_data)
    del item['pid']
    item['barcode'] = 'barcode'
    item = Item.create(item, dbcommit=True, reindex=True)
    flush_index(HoldingsSearch.Meta.index)
    assert item.holding_pid == holding_lib_martigny.pid
    assert item.holding_circulation_category_pid == \
        item_type_standard_martigny.pid
    item2 = deepcopy(item_lib_saxon_data)
    del item2['pid']
    item2 = Item.create(item2, dbcommit=True, reindex=True)
    flush_index(HoldingsSearch.Meta.index)
    assert item2.holding_pid != holding_lib_martigny.pid
    holding = Holding.get_record_by_pid(item2.holding_pid)
    assert holding.document_pid == document.pid
    assert holding.circulation_category_pid == item_type_standard_martigny.pid
    assert Holding.get_document_pid_by_holding_pid(item2.holding_pid) == \
        document.pid
    holdings = list(Holding.get_holdings_pid_by_document_pid(document.pid))
    assert holding_lib_martigny.pid in holdings
    assert item2.holding_pid in holdings
    can, reasons = holding_lib_martigny.can_delete
    assert not can
    assert reasons['links']['items']
    # test loan conditions
    assert holding_loan_condition_filter(holding_lib_martigny.pid) == \
        'standard'
    with pytest.raises(Exception):
        assert holding_loan_condition_filter('no pid')
    holdings = get_holdings_by_document_item_type(
        document.pid, item_type_standard_martigny.pid)
    assert holding_lib_martigny.pid == holdings[1].get('pid')
    assert list(holding_lib_martigny.get_items)[1].get('pid') == \
        item_lib_martigny.pid
    holding_lib_martigny.delete_from_index()
    assert not holding_lib_martigny.delete_from_index()
    holding_lib_martigny.dbcommit(forceindex=True)
    # test item count by holdings pid
    assert holding_lib_martigny.get_items_count_by_holding_pid == 2