[entities] make cw_fti_index_rql_queries predictable
authorJulien Cristau <julien.cristau@logilab.fr>
Fri, 13 Feb 2015 14:32:15 +0100
changeset 10251 2daa5c6dea4d
parent 10250 582301c2c8ca
child 10252 3b89cfd010a6
[entities] make cw_fti_index_rql_queries predictable Don't depend on the hash function, fixing test with python -R. Related to #4959402.
entities/__init__.py
entities/test/unittest_base.py
--- a/entities/__init__.py	Fri Feb 13 13:39:33 2015 +0100
+++ b/entities/__init__.py	Fri Feb 13 14:32:15 2015 +0100
@@ -53,7 +53,7 @@
         """
         restrictions = ['X is %s' % cls.__regid__]
         selected = ['X']
-        for attrschema in cls.e_schema.indexable_attributes():
+        for attrschema in sorted(cls.e_schema.indexable_attributes()):
             varname = attrschema.type.upper()
             restrictions.append('X %s %s' % (attrschema, varname))
             selected.append(varname)
--- a/entities/test/unittest_base.py	Fri Feb 13 13:39:33 2015 +0100
+++ b/entities/test/unittest_base.py	Fri Feb 13 14:32:15 2015 +0100
@@ -66,8 +66,8 @@
     def test_fti_rql_method(self):
         with self.admin_access.web_request() as req:
             eclass = self.vreg['etypes'].etype_class('EmailAddress')
-            self.assertEqual(['Any X, ALIAS, ADDRESS WHERE X is EmailAddress, '
-                              'X alias ALIAS, X address ADDRESS'],
+            self.assertEqual(['Any X, ADDRESS, ALIAS WHERE X is EmailAddress, '
+                              'X address ADDRESS, X alias ALIAS'],
                              eclass.cw_fti_index_rql_queries(req))