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') |
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): |
423 rql = 'RQLExpression X WHERE ET is CWEType, ET %s_permission X, ET name %%(name)s' % action |
423 rql = 'RQLExpression X WHERE ET is CWEType, ET %s_permission X, ET name %%(name)s' % action |
424 return self.mh.session.execute(rql, {'name': ertype}) |
424 return self.mh.session.execute(rql, {'name': ertype}) |