733 self.assertIn('notes', self.schema) |
733 self.assertIn('notes', self.schema) |
734 with self.mh() as (cnx, mh): |
734 with self.mh() as (cnx, mh): |
735 mh.cmd_drop_relation_type('notes') |
735 mh.cmd_drop_relation_type('notes') |
736 self.assertNotIn('notes', self.schema) |
736 self.assertNotIn('notes', self.schema) |
737 |
737 |
|
738 def test_computed_relation_sync_schema_props_perms(self): |
|
739 self.assertIn('whatever', self.schema) |
|
740 with self.mh() as (cnx, mh): |
|
741 mh.cmd_sync_schema_props_perms('whatever') |
|
742 self.assertEqual(self.schema['whatever'].rule, |
|
743 'S employees E, O associates E') |
|
744 self.assertEqual(self.schema['whatever'].objects(), ('Company',)) |
|
745 self.assertEqual(self.schema['whatever'].subjects(), ('Company',)) |
|
746 self.assertFalse(self.table_sql(mh, 'whatever_relation')) |
|
747 |
|
748 def test_computed_relation_sync_schema_props_perms_on_rdef(self): |
|
749 self.assertIn('whatever', self.schema) |
|
750 with self.mh() as (cnx, mh): |
|
751 with self.assertRaises(ExecutionError) as exc: |
|
752 mh.cmd_sync_schema_props_perms( |
|
753 ('Company', 'whatever', 'Person')) |
|
754 self.assertEqual(str(exc.exception), |
|
755 'Cannot synchronize a relation definition for a computed ' |
|
756 'relation (whatever)') |
|
757 |
738 |
758 |
739 if __name__ == '__main__': |
759 if __name__ == '__main__': |
740 unittest_main() |
760 unittest_main() |