def test_owner_can_remove_member_from_collection(
    user_owned_collection,
    another_normal_user_client: R2RClient,
    normal_user_client: R2RClient,
):
    """The owner should be able to remove a member from their collection."""
    # Add another user to the collection
    another_user_id = another_normal_user_client.users.me().results.id
    normal_user_client.collections.add_user(user_owned_collection,
                                            another_user_id)

    # Remove them
    remove_resp = normal_user_client.collections.remove_user(
        user_owned_collection, another_user_id).results
    assert remove_resp.success, "Owner could not remove member."

    # The removed user should no longer have access
    with pytest.raises(R2RException) as exc_info:
        another_normal_user_client.collections.retrieve(user_owned_collection)
    assert exc_info.value.status_code == 403, (
        "Removed user still has access after removal.")
The owner should be able to remove a member from their collection.
py/tests/integration/test_collections_users_interaction.py