[web/test] don't depend on iteration order on a set
authorJulien Cristau <julien.cristau@logilab.fr>
Fri, 13 Feb 2015 15:12:31 +0100
changeset 10255 55413788be10
parent 10254 e42c2226c878
child 10256 f753f364550f
[web/test] don't depend on iteration order on a set Fixes test under python -R ('pending_insert' in session data is a set, so we can't rely on any particular ordering). Related to #4959402.
web/test/unittest_views_basecontrollers.py
--- a/web/test/unittest_views_basecontrollers.py	Fri Feb 13 15:10:43 2015 +0100
+++ b/web/test/unittest_views_basecontrollers.py	Fri Feb 13 15:12:31 2015 +0100
@@ -836,9 +836,9 @@
             deletes = get_pending_deletes(req)
             self.assertEqual(deletes, [])
             inserts = get_pending_inserts(req)
-            self.assertEqual(inserts, ['12:tags:13', '12:tags:14'])
+            self.assertCountEqual(inserts, ['12:tags:13', '12:tags:14'])
             inserts = get_pending_inserts(req, 12)
-            self.assertEqual(inserts, ['12:tags:13', '12:tags:14'])
+            self.assertCountEqual(inserts, ['12:tags:13', '12:tags:14'])
             inserts = get_pending_inserts(req, 13)
             self.assertEqual(inserts, ['12:tags:13'])
             inserts = get_pending_inserts(req, 14)
@@ -855,9 +855,9 @@
             inserts = get_pending_inserts(req)
             self.assertEqual(inserts, [])
             deletes = get_pending_deletes(req)
-            self.assertEqual(deletes, ['12:tags:13', '12:tags:14'])
+            self.assertCountEqual(deletes, ['12:tags:13', '12:tags:14'])
             deletes = get_pending_deletes(req, 12)
-            self.assertEqual(deletes, ['12:tags:13', '12:tags:14'])
+            self.assertCountEqual(deletes, ['12:tags:13', '12:tags:14'])
             deletes = get_pending_deletes(req, 13)
             self.assertEqual(deletes, ['12:tags:13'])
             deletes = get_pending_deletes(req, 14)
@@ -880,7 +880,7 @@
         with self.remote_calling('add_pending_inserts',
                                  [('12', 'tags', '13'), ('12', 'tags', '14')]) as (_, req):
             inserts = get_pending_inserts(req)
-            self.assertEqual(inserts, ['12:tags:13', '12:tags:14'])
+            self.assertCountEqual(inserts, ['12:tags:13', '12:tags:14'])
             req.remove_pending_operations()