async def METHOD_NAME(status, fake2, snapshot, spawn_client):
    """
    Test that an existing document can be removed at ``DELETE /groups/:group_id``.
    """
    client = await spawn_client(authorize=True, administrator=True)
    group_1 = await fake2.groups.create(
        permissions=UpdatePermissionsRequest(create_sample=True, remove_file=True)
    )
    group_2 = await fake2.groups.create(
        permissions=UpdatePermissionsRequest(upload_file=True)
    )
    await fake2.users.create(groups=[group_1, group_2])
    await fake2.users.create(groups=[group_1])
    await fake2.users.create(groups=[group_2])
    resp = await client.delete(f"/groups/{'ghosts' if status == 404 else group_1.id}")
    assert resp.status == status
    assert await resp.json() == snapshot(name="json")
    if status == 204:
        assert await client.db.groups.count_documents({"_id": group_1.id}) == 0
    assert await client.db.users.find({}, ["name", "groups"]).to_list(None) == snapshot(
        name="users"
    )