def _create_and_publish(service, metadata, identity_simple):
    """Creates a draft and publishes it."""
    # Cannot create with record service due to the lack of versioning
    draft = service.create(identity=identity_simple, metadata=metadata)

    record = service.publish(draft.id, identity=identity_simple)

    assert record.id == draft.id

    # files attribute in record causes at create change the revision_id twice
    assert record._record.revision_id == 1

    return record