def METHOD_NAME(
    client, headers, running_app, minimal_record, users, location, superuser
):
    login_user(client, users[0])
    recid = create_draft(client, minimal_record, headers)
    init_file(client, recid, headers)
    upload_file(client, recid)
    # upload file and commit
    response = commit_file(client, recid, headers)
    logout_user(client)
    url = f"/records/{recid}/draft/media-files"
    # Anonymous user can't delete all files
    response = client.delete(url, headers=headers)
    assert response.status_code == 403
    # Different user can't delete all files
    login_user(client, users[1])
    response = client.delete(url, headers=headers)
    assert response.status_code == 403
    # Owner can delete all files
    logout_user(client)
    login_user(client, users[0])
    response = client.delete(url, headers=headers)
    assert response.status_code == 204