Use library function has_parent
Summary
The following commit introduced the library function has_parent
in a unit test. However this caused a failure.
Investigate how it is possible, that a parent with value None
instead of db.Entity can exist and fix it.