def METHOD_NAME(client, users, auth_headers_for_user,
                                       json_headers, create_deposit):
    owner, other_user = users['cms_user'], users['cms_user2']
    deposit = create_deposit(owner,
                             'test-analysis',
                             publish=True,
                             experiment='CMS')
    depid = deposit['_deposit']['id']
    resp = client.post('/deposits/{}/actions/clone'.format(depid),
                       headers=auth_headers_for_user(owner))
    assert resp.status_code == 201
    assert resp.json == {
        'id': depid,
        'type': 'deposit',
        'revision': 0,
        'schema': {
            'name': 'test-analysis',
            'version': '1.0.0'
        },
        'experiment': 'CMS',
        'status': 'draft',
        'created_by': owner.email,
        'cloned_from': depid,
        'created': resp.json['created'],
        'updated': resp.json['updated'],
        'metadata': {},
        'files': [],
        'access': {
            'deposit-admin': {
                'roles': [],
                'users': [owner.email]
            },
            'deposit-update': {
                'roles': [],
                'users': [owner.email]
            },
            'deposit-read': {
                'roles': [],
                'users': [owner.email]
            }
        },
        'links': {
            'bucket':
                'http://analysispreservation.cern.ch/api/files/{}'.format(
                    deposit.files.bucket),
            'clone':
                'http://analysispreservation.cern.ch/api/deposits/{}/actions/clone'
                .format(depid),
            'discard':
                'http://analysispreservation.cern.ch/api/deposits/{}/actions/discard'
                .format(depid),
            'edit':
                'http://analysispreservation.cern.ch/api/deposits/{}/actions/edit'
                .format(depid),
            'files':
                'http://analysispreservation.cern.ch/api/deposits/{}/files'.
                format(depid),
            'html':
                'http://analysispreservation.cern.ch/drafts/{}'.format(depid),
            'permissions':
                'http://analysispreservation.cern.ch/api/deposits/{}/actions/permissions'
                .format(depid),
            'publish':
                'http://analysispreservation.cern.ch/api/deposits/{}/actions/publish'
                .format(depid),
            'self':
                'http://analysispreservation.cern.ch/api/deposits/{}'.format(
                    depid),
            'upload':
                'http://analysispreservation.cern.ch/api/deposits/{}/actions/upload'
                .format(depid)
        }
    }