def METHOD_NAME(record, doi):
    # Edit mode
    draft = client.post(link(record["links"]["draft"]))
    assert draft.status_code == 201
    # Update
    data = draft.json
    data["pids"]["doi"]["identifier"] = doi
    res = client.put(link(draft.json["links"]["self"]), headers=headers, json=data)
    assert res.status_code == 200
    # Publish
    record = client.post(link(draft.json["links"]["publish"]), headers=headers)
    assert record.status_code == 202
    return record