--- a/test/unittest_rqlrewrite.py Fri Apr 22 16:23:34 2011 +0200
+++ b/test/unittest_rqlrewrite.py Tue Apr 26 16:14:43 2011 +0200
@@ -353,14 +353,21 @@
self.failUnlessEqual(rqlst.as_string(),
u"Any C WHERE C is Card, EXISTS(C owned_by A, A is CWUser)")
- def test_rqlexpr_not_relation1(self):
+ def test_rqlexpr_not_relation_1_1(self):
constraint = RRQLExpression('X owned_by Z, Z login "hop"', 'X')
rqlst = parse('Affaire A WHERE NOT EXISTS(A documented_by C)')
rewrite(rqlst, {('C', 'X'): (constraint,)}, {}, 'X')
self.failUnlessEqual(rqlst.as_string(),
u'Any A WHERE NOT EXISTS(A documented_by C, EXISTS(C owned_by B, B login "hop", B is CWUser), C is Card), A is Affaire')
- def test_rqlexpr_not_relation2(self):
+ def test_rqlexpr_not_relation_1_2(self):
+ constraint = RRQLExpression('X owned_by Z, Z login "hop"', 'X')
+ rqlst = parse('Affaire A WHERE NOT EXISTS(A documented_by C)')
+ rewrite(rqlst, {('A', 'X'): (constraint,)}, {}, 'X')
+ self.failUnlessEqual(rqlst.as_string(),
+ u'Any A WHERE NOT EXISTS(A documented_by C, C is Card), A is Affaire, EXISTS(A owned_by B, B login "hop", B is CWUser)')
+
+ def test_rqlexpr_not_relation_2(self):
constraint = RRQLExpression('X owned_by Z, Z login "hop"', 'X')
rqlst = rqlhelper.parse('Affaire A WHERE NOT A documented_by C', annotate=False)
rewrite(rqlst, {('C', 'X'): (constraint,)}, {}, 'X')