def METHOD_NAME(
        rotkehlchen_api_server: APIServer,
        data_dir: Path,
        username: str,
):
    """Test that creating, downloading and deleting a backup works fine"""
    start_ts = ts_now()
    response = requests.put(api_url_for(rotkehlchen_api_server, 'databasebackupsresource'))
    filepath = Path(assert_proper_response_with_result(response))
    assert filepath.exists()
    assert filepath.parent == Path(data_dir, username)
    response = requests.get(api_url_for(rotkehlchen_api_server, 'databaseinforesource'))
    result = assert_proper_response_with_result(response)
    backups = result['userdb']['backups']
    assert len(backups) == 1
    assert backups[0]['time'] >= start_ts
    assert backups[0]['version'] == ROTKEHLCHEN_DB_VERSION
    # now also try to download that backup and make sure it's the same file
    response = requests.get(
        api_url_for(rotkehlchen_api_server, 'databasebackupsresource'),
        json={'file': str(filepath)},
    )
    with tempfile.TemporaryDirectory() as tmpdirname:
        tempdbpath = Path(tmpdirname, 'temp.db')
        tempdbpath.write_bytes(response.content)
        assert filecmp.cmp(filepath, tempdbpath)
    # create an extra database to check that lists work correctly
    second_filepath = filepath.parent / 'back.db'
    second_filepath.touch()
    response = requests.delete(
        api_url_for(
            rotkehlchen_api_server,
            'databasebackupsresource'),
        json={'files': [str(filepath), str(second_filepath)]},
    )
    assert_simple_ok_response(response)
    assert not filepath.exists()
    assert not second_filepath.exists()
    response = requests.get(api_url_for(rotkehlchen_api_server, 'databaseinforesource'))
    result = assert_proper_response_with_result(response)
    backups = result['userdb']['backups']
    assert len(backups) == 0