def _assert_people_match(
            self, expected_people, matched_people, debug=False):
        converted_matched = \
            converter.convert_schema_objects_to_entity(matched_people)
        db_expected_with_backedges = \
            converter.convert_entity_people_to_schema_people(expected_people)
        expected_with_backedges = \
            converter.convert_schema_objects_to_entity(
                db_expected_with_backedges)

        clear_db_ids(converted_matched)
        clear_db_ids(expected_with_backedges)

        if debug:
            print('============== EXPECTED WITH BACKEDGES ==============')
            print_entity_trees(expected_with_backedges)
            print('============== CONVERTED MATCHED ==============')
            print_entity_trees(converted_matched)
        self.assertCountEqual(expected_with_backedges, converted_matched)
 def convert_and_clear_db_ids(db_entities: List[StateBase]) -> List[Entity]:
     converted = StateSchemaToEntityConverter().convert_all(
         db_entities, populate_back_edges=True)
     clear_db_ids(converted)
     return converted