[test] give a non-ambiguous order to sync_schema assertion (closes #3001959) stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 10 Jul 2013 15:03:50 +0200
branchstable
changeset 9151 78071e41926f
parent 9150 34b379ac76fb
child 9157 3e4bef7d514d
[test] give a non-ambiguous order to sync_schema assertion (closes #3001959) Sorting by ordernum alone is unstable since several values have the same ordernum. ordernum + name should be stable.
server/test/unittest_migractions.py
--- a/server/test/unittest_migractions.py	Tue Jul 09 17:33:43 2013 +0200
+++ b/server/test/unittest_migractions.py	Wed Jul 10 15:03:50 2013 +0200
@@ -370,14 +370,14 @@
                                          'X description D')[0][0],
                           'title for this person')
         rinorder = [n for n, in cursor.execute(
-            'Any N ORDERBY O WHERE X is CWAttribute, X relation_type RT, RT name N,'
+            'Any N ORDERBY O,N WHERE X is CWAttribute, X relation_type RT, RT name N,'
             'X from_entity FE, FE name "Personne",'
             'X ordernum O')]
         expected = [u'nom', u'prenom', u'sexe', u'promo', u'ass', u'adel', u'titre',
-                    u'web', u'tel', u'fax', u'datenaiss', u'tzdatenaiss', u'test',
+                    u'web', u'tel', u'fax', u'datenaiss', u'test', u'tzdatenaiss',
                     u'description', u'firstname',
                     u'creation_date', u'cwuri', u'modification_date']
-        self.assertEqual(rinorder, expected)
+        self.assertEqual(expected, rinorder)
 
         # test permissions synchronization ####################################
         # new rql expr to add note entity