def test_user_cannot_remove_document_from_collection_they_cannot_edit(
    normal_user_client: R2RClient, ):
    """A user who is just a member should not remove documents."""
    # Create a collection
    coll_id = normal_user_client.collections.create(
        name="Removable", description="desc").results.id

    # Create a document in it
    doc_id = normal_user_client.documents.create(
        raw_text="Doc in coll").results.document_id
    normal_user_client.collections.add_document(coll_id, doc_id)

    # Create another user and add as member
    another_email = f"amember_{uuid.uuid4()}@test.com"
    another_password = "memberpwd"
    member_client = R2RClient(normal_user_client.base_url)
    member_client.users.create(another_email, another_password)
    member_client.users.login(another_email, another_password)
    member_id = member_client.users.me().results.id
    user_email = normal_user_client.users.me().results.email

    # Add member to collection
    normal_user_client.users.logout()
    normal_user_client.users.login(user_email, "normal_password")
    normal_user_client.collections.add_user(coll_id, member_id)

    # Member tries to remove the document
    with pytest.raises(R2RException) as exc_info:
        member_client.collections.remove_document(coll_id, doc_id)
    assert exc_info.value.status_code == 403, (
        "Member should not remove documents.")

    # Cleanup
    normal_user_client.collections.delete(coll_id)
A user who is just a member should not remove documents.
py/tests/integration/test_collections_users_interaction.py