def _add_household_person_relation(self): rel = create_relation(self.profile) person_entity = add_person_entity(self.profile) append_person_columns(person_entity) household_entity = add_household_entity(self.profile) rel.parent = household_entity rel.child = person_entity rel.child_column = 'household_id' rel.parent_column = 'id' return rel
def test_create_association_entity(self): person_entity = add_person_entity(self.profile) household_entity = add_household_entity(self.profile) assoc_ent = self.profile.create_association_entity('person_household') assoc_ent.first_parent = person_entity assoc_ent.second_parent = household_entity self.profile.add_entity(assoc_ent) profile_assoc_entities = self.profile.entities_by_type_info( AssociationEntity.TYPE_INFO) self.assertGreater(profile_assoc_entities, 0, 'There are no ' 'association entities ' 'in the collection.')