[querier test] remove some actually bad tests that were passing thanks to a sqlite bug stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 09 Sep 2010 10:07:56 +0200
branchstable
changeset 6194 2a1f8cabbe6a
parent 6193 a58097ee4f15
child 6195 a0c4441e6ddf
[querier test] remove some actually bad tests that were passing thanks to a sqlite bug Now, rql has been fixed to correctly detect this kind of query can't be answered correctly
server/test/unittest_querier.py
server/test/unittest_rql2sql.py
--- a/server/test/unittest_querier.py	Wed Sep 08 10:32:46 2010 +0200
+++ b/server/test/unittest_querier.py	Thu Sep 09 10:07:56 2010 +0200
@@ -678,10 +678,8 @@
         self.assertEqual(len(rset.rows), 1, rset.rows)
 
     def test_select_ordered_distinct_1(self):
-        self.execute("INSERT Affaire X: X sujet 'cool', X ref '1'")
-        self.execute("INSERT Affaire X: X sujet 'cool', X ref '2'")
-        rset = self.execute('DISTINCT Any S ORDERBY R WHERE A is Affaire, A sujet S, A ref R')
-        self.assertEqual(rset.rows, [['cool']])
+        self.assertRaises(BadRQLQuery,
+                          self.execute, 'DISTINCT Any S ORDERBY R WHERE A is Affaire, A sujet S, A ref R')
 
     def test_select_ordered_distinct_2(self):
         self.execute("INSERT Affaire X: X sujet 'minor'")
--- a/server/test/unittest_rql2sql.py	Wed Sep 08 10:32:46 2010 +0200
+++ b/server/test/unittest_rql2sql.py	Thu Sep 09 10:07:56 2010 +0200
@@ -429,11 +429,6 @@
 GROUP BY _X.cw_data_name,_X.cw_data_format
 ORDER BY 1,2,_X.cw_data_format'''),
 
-    ('DISTINCT Any S ORDERBY R WHERE A is Affaire, A sujet S, A ref R',
-     '''SELECT T1.C0 FROM (SELECT DISTINCT _A.cw_sujet AS C0, _A.cw_ref AS C1
-FROM cw_Affaire AS _A
-ORDER BY 2) AS T1'''),
-
     ('DISTINCT Any MAX(X)+MIN(LENGTH(D)), N GROUPBY N ORDERBY 2, DF WHERE X data_name N, X data D, X data_format DF;',
      '''SELECT T1.C0,T1.C1 FROM (SELECT DISTINCT (MAX(_X.cw_eid) + MIN(LENGTH(_X.cw_data))) AS C0, _X.cw_data_name AS C1, _X.cw_data_format AS C2
 FROM cw_File AS _X