145 'identity', 'in_basket', 'is', 'is_instance_of', |
145 'identity', 'in_basket', 'is', 'is_instance_of', |
146 'modification_date', 'name', 'owned_by']) |
146 'modification_date', 'name', 'owned_by']) |
147 self.assertEquals([str(rs) for rs in self.schema['Folder2'].object_relations()], |
147 self.assertEquals([str(rs) for rs in self.schema['Folder2'].object_relations()], |
148 ['filed_under2', 'identity']) |
148 ['filed_under2', 'identity']) |
149 self.assertEquals(sorted(str(e) for e in self.schema['filed_under2'].subjects()), |
149 self.assertEquals(sorted(str(e) for e in self.schema['filed_under2'].subjects()), |
150 sorted(str(e) for e in self.schema.entities() if not e.is_final())) |
150 sorted(str(e) for e in self.schema.entities() if not e.final)) |
151 self.assertEquals(self.schema['filed_under2'].objects(), ('Folder2',)) |
151 self.assertEquals(self.schema['filed_under2'].objects(), ('Folder2',)) |
152 eschema = self.schema.eschema('Folder2') |
152 eschema = self.schema.eschema('Folder2') |
153 for cstr in eschema.constraints('name'): |
153 for cstr in eschema.constraints('name'): |
154 self.failUnless(hasattr(cstr, 'eid')) |
154 self.failUnless(hasattr(cstr, 'eid')) |
155 |
155 |
174 self.mh.cmd_add_entity_type('Folder2', auto=False) |
174 self.mh.cmd_add_entity_type('Folder2', auto=False) |
175 self.mh.cmd_add_relation_type('filed_under2') |
175 self.mh.cmd_add_relation_type('filed_under2') |
176 self.schema.rebuild_infered_relations() |
176 self.schema.rebuild_infered_relations() |
177 self.failUnless('filed_under2' in self.schema) |
177 self.failUnless('filed_under2' in self.schema) |
178 self.assertEquals(sorted(str(e) for e in self.schema['filed_under2'].subjects()), |
178 self.assertEquals(sorted(str(e) for e in self.schema['filed_under2'].subjects()), |
179 sorted(str(e) for e in self.schema.entities() if not e.is_final())) |
179 sorted(str(e) for e in self.schema.entities() if not e.final)) |
180 self.assertEquals(self.schema['filed_under2'].objects(), ('Folder2',)) |
180 self.assertEquals(self.schema['filed_under2'].objects(), ('Folder2',)) |
181 self.mh.cmd_drop_relation_type('filed_under2') |
181 self.mh.cmd_drop_relation_type('filed_under2') |
182 self.failIf('filed_under2' in self.schema) |
182 self.failIf('filed_under2' in self.schema) |
183 |
183 |
184 def test_add_relation_definition_nortype(self): |
184 def test_add_relation_definition_nortype(self): |