def METHOD_NAME(
    self, db_session, user
):
    # Add a couple of noise UserIdentity's. These should not be removed
    # from the DB.
    models.UserIdentity(provider="provider", provider_unique_id="1", user=user)
    models.UserIdentity(provider="provider", provider_unique_id="2", user=user)
    # The UserIdentity that we are going to remove.
    user_identity = models.UserIdentity(
        provider="provider", provider_unique_id="3", user=user
    )
    user.identities.remove(user_identity)
    assert user_identity not in db_session.query(models.UserIdentity).all()