test/unittest_rset.py
changeset 4951 7dc54e12c606
parent 4850 bd640b137f50
parent 4939 349af486f5ed
child 5174 78438ad513ca
child 5421 8167de96c523
--- a/test/unittest_rset.py	Thu Mar 18 17:31:22 2010 +0100
+++ b/test/unittest_rset.py	Thu Mar 18 17:39:17 2010 +0100
@@ -371,6 +371,18 @@
         rset = self.execute(u'Any X WHERE X has_text %(text)s', {'text' : 'foo'})
         self.assertEquals(rset.searched_text(), 'foo')
 
+    def test_union_limited_rql(self):
+        rset = self.execute('(Any X,N WHERE X is Bookmark, X title N)'
+                            ' UNION '
+                            '(Any X,N WHERE X is CWGroup, X name N)')
+        rset.limit(2, 10, inplace=True)
+        self.assertEquals(rset.limited_rql(),
+                          'Any A,B LIMIT 2 OFFSET 10 '
+                          'WITH A,B BEING ('
+                          '(Any X,N WHERE X is Bookmark, X title N) '
+                          'UNION '
+                          '(Any X,N WHERE X is CWGroup, X name N)'
+                          ')')
 
 if __name__ == '__main__':
     unittest_main()