def METHOD_NAME(self, pyramid_request, search_index, UserRenameService):
    svc = service_factory(sentinel.context, pyramid_request)
    UserRenameService.assert_called_once_with(
        session=pyramid_request.db, search_index=search_index
    )
    assert svc == UserRenameService.return_value