def METHOD_NAME(db, client, files, username, password, project_id, snapshot_id):
    client.login(username=username, password=password)
    project = Project.objects.get(pk=project_id)
    project_snapshots = list(project.snapshots.values_list('id', flat=True))
    url = reverse('snapshot_rollback', args=[project_id, snapshot_id])
    response = client.post(url)
    # check if all the files are where are supposed to be
    for file_value in Value.objects.filter(value_type=VALUE_TYPE_FILE):
        assert Path(settings.MEDIA_ROOT).joinpath(file_value.file.name).exists()
    if snapshot_id in project_snapshots:
        if project_id in rollback_snapshot_permission_map.get(username, []):
            assert response.status_code == 302
        elif password:
            assert response.status_code == 403
        else:
            assert response.status_code == 302
    else:
        assert response.status_code == 404