Commit 7cd21947 authored by Julien Cristau's avatar Julien Cristau
Browse files

[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.
parent e42c2226c878
......@@ -836,9 +836,9 @@ class AjaxControllerTC(CubicWebTC):
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 @@ class AjaxControllerTC(CubicWebTC):
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 @@ class AjaxControllerTC(CubicWebTC):
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()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment