I'd prefer to see tests for `... is not None`, in case that `top.parent_id` evaluates to a falsy value.