Exemple #1
0
    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
Exemple #2
0
    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
Exemple #3
0
    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.')
Exemple #4
0
    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.')
Exemple #5
0
 def test_entities_by_type_info(self):
     person_entity = add_person_entity(self.profile)
     entities = self.profile.entities_by_type_info('ENTITY')
     self.assertGreater(
         len(entities), 0, 'There no entities of ENTITY '
         'type info in the collection.')
Exemple #6
0
    def test_remove_entity(self):
        person_entity = add_person_entity(self.profile)
        status = self.profile.remove_entity(PERSON_ENTITY)

        self.assertTrue(status)
Exemple #7
0
 def test_add_entity(self):
     person_entity = add_person_entity(self.profile)
     person_item = self.profile.entity(PERSON_ENTITY)
     self.assertIsNotNone(person_item)
Exemple #8
0
    def test_remove_entity(self):
        person_entity = add_person_entity(self.profile)
        status = self.profile.remove_entity(PERSON_ENTITY)

        self.assertTrue(status)
Exemple #9
0
 def test_add_entity(self):
     person_entity = add_person_entity(self.profile)
     person_item = self.profile.entity(PERSON_ENTITY)
     self.assertIsNotNone(person_item)
Exemple #10
0
 def test_entities_by_type_info(self):
     person_entity = add_person_entity(self.profile)
     entities = self.profile.entities_by_type_info('ENTITY')
     self.assertGreater(len(entities), 0, 'There no entities of ENTITY '
                                          'type info in the collection.')