[querier test] test groupby function call / column number
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 18 May 2011 16:04:47 +0200
changeset 7392 230f2511ad28
parent 7391 28ebf0b8d642
child 7397 6a9e66d788b3
[querier test] test groupby function call / column number
server/test/unittest_querier.py
--- a/server/test/unittest_querier.py	Tue May 17 07:37:13 2011 +0200
+++ b/server/test/unittest_querier.py	Wed May 18 16:04:47 2011 +0200
@@ -311,6 +311,14 @@
         seid = self.execute('State X WHERE X name "deactivated"')[0][0]
         rset = self.execute('Any U,L,S GROUPBY U,L,S WHERE X in_state S, U login L, S eid %s' % seid)
 
+    def test_select_groupby_funccall(self):
+        rset = self.execute('Any YEAR(CD), COUNT(X) GROUPBY YEAR(CD) WHERE X is CWUser, X creation_date CD')
+        self.assertListEqual(rset.rows, [[date.today().year, 2]])
+
+    def test_select_groupby_colnumber(self):
+        rset = self.execute('Any YEAR(CD), COUNT(X) GROUPBY 1 WHERE X is CWUser, X creation_date CD')
+        self.assertListEqual(rset.rows, [[date.today().year, 2]])
+
     def test_select_complex_orderby(self):
         rset1 = self.execute('Any N ORDERBY N WHERE X name N')
         self.assertEqual(sorted(rset1.rows), rset1.rows)