cubicweb/test/unittest_entity.py
changeset 11290 12d226a5bab9
parent 11279 e4f11ef1face
child 11759 7b7108eb8178
--- a/cubicweb/test/unittest_entity.py	Thu Jun 02 17:52:43 2016 +0200
+++ b/cubicweb/test/unittest_entity.py	Fri Apr 15 10:20:34 2016 +0200
@@ -319,6 +319,17 @@
                              'WHERE E eid %(x)s, E tags X, X is Personne, X modification_date AA, '
                              'X nom AB')
 
+    def test_related_rql_sort_terms(self):
+        with self.admin_access.web_request() as req:
+            tag = self.vreg['etypes'].etype_class('Tag')(req)
+            select = tag.cw_related_rqlst('tags', 'subject',
+                                          sort_terms=(('nom', True),
+                                                      ('modification_date', False)))
+            expected = (
+                'Any X,AA ORDERBY AB,AA DESC '
+                'WHERE E eid %(x)s, E tags X, X modification_date AA, X nom AB')
+            self.assertEqual(select.as_string(), expected)
+
     def test_related_rql_ambiguous_cant_use_fetch_order(self):
         with self.admin_access.web_request() as req:
             tag = self.vreg['etypes'].etype_class('Tag')(req)