[test] Fix randomness in tests
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 20 Jun 2016 17:56:49 +0200
changeset 11357 ef53a59140e1
parent 11356 17070ff16000
child 11358 179b5ff3f428
[test] Fix randomness in tests
cubicweb/ext/test/unittest_rest.py
--- a/cubicweb/ext/test/unittest_rest.py	Wed Jun 22 07:56:51 2016 +0200
+++ b/cubicweb/ext/test/unittest_rest.py	Mon Jun 20 17:56:49 2016 +0200
@@ -72,7 +72,7 @@
     def test_rql_role_with_vid(self):
         with self.admin_access.web_request() as req:
             context = self.context(req)
-            out = rest_publish(context, ':rql:`Any X WHERE X is CWUser:table`')
+            out = rest_publish(context, ':rql:`Any X ORDERBY XL WHERE X is CWUser, X login XL:table`')
             self.assertTrue(out.endswith('<a href="http://testing.fr/cubicweb/cwuser/anon" '
                                          'title="">anon</a></td></tr>\n</tbody></table>'
                                          '</div></p>\n'))
@@ -96,7 +96,7 @@
     def test_rql_role_without_vid(self):
         with self.admin_access.web_request() as req:
             context = self.context(req)
-            out = rest_publish(context, ':rql:`Any X WHERE X is CWUser`')
+            out = rest_publish(context, ':rql:`Any X,XL ORDERBY XL WHERE X is CWUser, X login XL`')
             self.assertEqual(out, u'<p><h1>CWUser_plural</h1><div class="section">'
                              '<a href="http://testing.fr/cubicweb/cwuser/admin" title="">admin</a>'
                              '</div><div class="section">'
@@ -107,7 +107,7 @@
         with self.admin_access.web_request() as req:
             context = self.context(req)
             rset = req.execute('INSERT Bookmark X: X title "hello", X path '
-                               '"/view?rql=Any X WHERE X is CWUser"')
+                               '"/view?rql=Any X,XL ORDERBY XL WHERE X is CWUser, X login XL"')
             eid = rset[0][0]
             out = rest_publish(context, ':bookmark:`%s`' % eid)
             self.assertEqual(out, u'<p><h1>CWUser_plural</h1><div class="section">'