def METHOD_NAME(
        client, patron_transaction_overdue_event_martigny):
    """Test record retrieval."""
    patron_event = patron_transaction_overdue_event_martigny
    pid = patron_event.pid
    item_url = url_for('invenio_records_rest.ptre_item', pid_value=pid)
    list_url = url_for('invenio_records_rest.ptre_list', q=f'pid:{pid}')
    item_url_with_resolve = url_for(
        'invenio_records_rest.ptre_item',
        pid_value=pid,
        resolve=1,
        sources=1
    )
    res = client.get(item_url)
    assert res.status_code == 200
    assert res.headers['ETag'] == f'"{patron_event.revision_id}"'
    data = get_json(res)
    assert patron_event.dumps() == data['metadata']
    # Check metadata
    for k in ['created', 'updated', 'metadata', 'links']:
        assert k in data
    # Check self links
    res = client.get(to_relative_url(data['links']['self']))
    assert res.status_code == 200
    assert data == get_json(res)
    assert patron_event.dumps() == data['metadata']
    # check resolve
    res = client.get(item_url_with_resolve)
    assert res.status_code == 200
    data = get_json(res)
    assert patron_event.replace_refs().dumps() == data['metadata']
    res = client.get(list_url)
    assert res.status_code == 200
    data = get_json(res)
    result = data['hits']['hits'][0]['metadata']
    # delete dynamically added keys (listener)
    del result['organisation']
    del result['patron']
    del result['category']
    del result['owning_library']
    del result['owning_location']
    del result['patron_type']
    assert result == patron_event.replace_refs()