Why not check the node's parent against the node you're trying to find?
if desired_parent == child.get_parent():
print("desired_parent is the parent of child.")
You can also check for the name of the parent:
if child.get_parent().get_name() == "correct parent":
print("The correct parent is found.")