[devtools] Sort _cw_fields in fake_form
authorRémi Cardona <remi.cardona@logilab.fr>
Fri, 26 Jun 2015 16:28:56 +0200
changeset 10468 3f27669634d2
parent 10467 73ea636a5562
child 10469 bd78f563e812
[devtools] Sort _cw_fields in fake_form Try to generate a predictable string, to help testing with PYTHONHASHSEED=random.
devtools/test/unittest_testlib.py
devtools/testlib.py
--- a/devtools/test/unittest_testlib.py	Fri Jun 26 16:29:28 2015 +0200
+++ b/devtools/test/unittest_testlib.py	Fri Jun 26 16:28:56 2015 +0200
@@ -42,7 +42,7 @@
                                 '__maineid': 0,
                                 '__type:0': 'Entity',
                                 '_cw_entity_fields:0': '__type,field',
-                                '_cw_fields': 'file,encoding',
+                                '_cw_fields': 'encoding,file',
                                 'eid': [0],
                                 'encoding': u'utf-8',
                                 'field:0': 'value',
--- a/devtools/testlib.py	Fri Jun 26 16:29:28 2015 +0200
+++ b/devtools/testlib.py	Fri Jun 26 16:28:56 2015 +0200
@@ -724,7 +724,7 @@
             if entity_fields:
                 form[eid_param('_cw_entity_fields', entity.eid)] = ','.join(entity_fields)
         if fields:
-            form['_cw_fields'] = ','.join(fields)
+            form['_cw_fields'] = ','.join(sorted(fields))
         return form
 
     @deprecated('[3.19] use .admin_request_from_url instead')