def METHOD_NAME(db, client, username, password, project_id):
    client.login(username=username, password=password)
    url = reverse(urlnames['list'], args=[project_id])
    response = client.get(url)
    if project_id in view_membership_permission_map.get(username, []):
        assert response.status_code == 200
        if username == 'user':
            assert sorted([item['id'] for item in response.json()]) == []
        else:
            values_list = Membership.objects.filter(project_id=project_id) \
                                            .order_by('id').values_list('id', flat=True)
            assert sorted([item['id'] for item in response.json()]) == list(values_list)
    else:
        assert response.status_code == 404