server/test/unittest_migractions.py
changeset 6635 4e560631f36d
parent 6632 78878f5a8166
child 6781 5062d86d6ffe
equal deleted inserted replaced
6634:0683748bca81 6635:4e560631f36d
   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):