test/unittest_rset.py
branch3.5
changeset 3022 238ad682bcb7
parent 3016 5787d1cc8106
child 3023 7864fee8b4ec
child 3587 5b3725f315fc
equal deleted inserted replaced
3019:bdb120240d75 3022:238ad682bcb7
   326         self.assertEquals(entity.eid, e.eid)
   326         self.assertEquals(entity.eid, e.eid)
   327         self.assertEquals(rtype, 'title')
   327         self.assertEquals(rtype, 'title')
   328         entity, rtype = rset.related_entity(1, 1)
   328         entity, rtype = rset.related_entity(1, 1)
   329         self.assertEquals(entity.id, 'CWGroup')
   329         self.assertEquals(entity.id, 'CWGroup')
   330         self.assertEquals(rtype, 'name')
   330         self.assertEquals(rtype, 'name')
       
   331         #
   331         rset = self.execute('Any X,N ORDERBY N WHERE X is Bookmark WITH X,N BEING '
   332         rset = self.execute('Any X,N ORDERBY N WHERE X is Bookmark WITH X,N BEING '
   332                             '((Any X,N WHERE X is CWGroup, X name N)'
   333                             '((Any X,N WHERE X is CWGroup, X name N)'
   333                             ' UNION '
   334                             ' UNION '
   334                             ' (Any X,N WHERE X is Bookmark, X title N))')
   335                             ' (Any X,N WHERE X is Bookmark, X title N))')
       
   336         entity, rtype = rset.related_entity(0, 1)
       
   337         self.assertEquals(entity.eid, e.eid)
       
   338         self.assertEquals(rtype, 'title')
       
   339         #
       
   340         rset = self.execute('Any X,N ORDERBY N WITH N,X BEING '
       
   341                             '((Any N,X WHERE X is CWGroup, X name N)'
       
   342                             ' UNION '
       
   343                             ' (Any N,X WHERE X is Bookmark, X title N))')
   335         entity, rtype = rset.related_entity(0, 1)
   344         entity, rtype = rset.related_entity(0, 1)
   336         self.assertEquals(entity.eid, e.eid)
   345         self.assertEquals(entity.eid, e.eid)
   337         self.assertEquals(rtype, 'title')
   346         self.assertEquals(rtype, 'title')
   338 
   347 
   339     def test_entities(self):
   348     def test_entities(self):