412 self.mh.commit() |
412 self.mh.commit() |
413 # unique_together test |
413 # unique_together test |
414 self.assertEqual(len(self.schema.eschema('Personne')._unique_together), 1) |
414 self.assertEqual(len(self.schema.eschema('Personne')._unique_together), 1) |
415 self.assertItemsEqual(self.schema.eschema('Personne')._unique_together[0], |
415 self.assertItemsEqual(self.schema.eschema('Personne')._unique_together[0], |
416 ('nom', 'prenom', 'datenaiss')) |
416 ('nom', 'prenom', 'datenaiss')) |
417 rset = cursor.execute('Any C WHERE C is CWUniqueTogetherConstraint') |
417 rset = cursor.execute('Any C WHERE C is CWUniqueTogetherConstraint, C constraint_of ET, ET name "Personne"') |
418 self.assertEqual(len(rset), 1) |
418 self.assertEqual(len(rset), 1) |
419 relations = [r.rtype.name for r in rset.get_entity(0, 0).relations] |
419 relations = [r.rtype.name for r in rset.get_entity(0, 0).relations] |
420 self.assertItemsEqual(relations, ('nom', 'prenom', 'datenaiss')) |
420 self.assertItemsEqual(relations, ('nom', 'prenom', 'datenaiss')) |
421 |
421 |
422 def _erqlexpr_rset(self, action, ertype): |
422 def _erqlexpr_rset(self, action, ertype): |