test/unittest_schema.py
branchstable
changeset 4132 440d383367eb
parent 3978 2c95e3033f64
child 4181 c79135c217df
child 4212 ab6573088b4a
--- a/test/unittest_schema.py	Thu Dec 17 17:22:36 2009 +0100
+++ b/test/unittest_schema.py	Fri Dec 18 10:26:47 2009 +0100
@@ -22,7 +22,7 @@
     CubicWebSchema, CubicWebEntitySchema, CubicWebSchemaLoader,
     RQLConstraint, RQLUniqueConstraint, RQLVocabularyConstraint,
     ERQLExpression, RRQLExpression,
-    normalize_expression, order_eschemas)
+    normalize_expression, order_eschemas, guess_rrqlexpr_mainvars)
 from cubicweb.devtools import TestServerConfiguration as TestConfiguration
 
 DATADIR = join(dirname(__file__), 'data')
@@ -275,5 +275,10 @@
         self.assertEquals(normalize_expression('X  bla Y,Y blur Z  ,  Z zigoulou   X '),
                                                'X bla Y, Y blur Z, Z zigoulou X')
 
+class GuessRrqlExprMainVarsTC(TestCase):
+    def test_exists(self):
+        mainvars = guess_rrqlexpr_mainvars(normalize_expression('NOT EXISTS(O team_competition C, C level < 3)'))
+        self.assertEquals(mainvars, 'O')
+
 if __name__ == '__main__':
     unittest_main()