server/test/unittest_msplanner.py
branchstable
changeset 6758 28b11ecf319b
parent 6676 39763487ba33
child 6759 5d016d5bacca
equal deleted inserted replaced
6757:bc878ec35794 6758:28b11ecf319b
  1605                      [self.cards, self.system], None,
  1605                      [self.cards, self.system], None,
  1606                      {'T': 'table0.C1', 'X': 'table0.C0', 'X.type': 'table0.C1'}, []),
  1606                      {'T': 'table0.C1', 'X': 'table0.C0', 'X.type': 'table0.C1'}, []),
  1607                     ('FetchStep',  [('Any Y,T WHERE Y type T, Y is Note', [{'T': 'String', 'Y': 'Note'}])],
  1607                     ('FetchStep',  [('Any Y,T WHERE Y type T, Y is Note', [{'T': 'String', 'Y': 'Note'}])],
  1608                      [self.cards, self.system], None,
  1608                      [self.cards, self.system], None,
  1609                      {'T': 'table1.C1', 'Y': 'table1.C0', 'Y.type': 'table1.C1'},  []),
  1609                      {'T': 'table1.C1', 'Y': 'table1.C0', 'Y.type': 'table1.C1'},  []),
  1610                     ('UnionStep', None,  None,
  1610                     ('FetchStep', [('Any X,Y WHERE X multisource_crossed_rel Y, X is Note, Y is Note',
  1611                      [('OneFetchStep', [('Any X,Y,T WHERE X multisource_crossed_rel Y, Y type T, X type T, X is Note, Y is Note',
  1611                                     [{'X': 'Note', 'Y': 'Note'}])],
  1612                                          [{'T': 'String', 'X': 'Note', 'Y': 'Note'}])],
  1612                      [self.cards, self.system], None,
  1613                        None, None, [self.cards], None,
  1613                      {'X': 'table2.C0', 'Y': 'table2.C1'},
  1614                        []),
  1614                      []),
  1615                       ('OneFetchStep', [('Any X,Y,T WHERE X multisource_crossed_rel Y, Y type T, X type T, X is Note, Y is Note',
  1615                     ('OneFetchStep', [('Any X,Y,T WHERE X multisource_crossed_rel Y, Y type T, X type T, '
  1616                                          [{'T': 'String', 'X': 'Note', 'Y': 'Note'}])],
  1616                                        'X is Note, Y is Note, Y identity A, X identity B, A is Note, B is Note',
  1617                        None, None, [self.system],
  1617                                        [{u'A': 'Note', u'B': 'Note', 'T': 'String', 'X': 'Note', 'Y': 'Note'}])],
  1618                        {'T': 'table1.C1', 'X': 'table0.C0', 'X.type': 'table0.C1',
  1618                      None, None,
  1619                         'Y': 'table1.C0', 'Y.type': 'table1.C1'},
  1619                      [self.system],
  1620                        [])]
  1620                      {'A': 'table1.C0',
  1621                      )],
  1621                       'B': 'table0.C0',
       
  1622                       'T': 'table1.C1',
       
  1623                       'X': 'table2.C0',
       
  1624                       'X.type': 'table0.C1',
       
  1625                       'Y': 'table2.C1',
       
  1626                       'Y.type': 'table1.C1'},
       
  1627                      []),
       
  1628                     ],
  1622                     {'x': 999999,})
  1629                     {'x': 999999,})
       
  1630 
       
  1631     def test_crossed_relation_noeid_needattr(self):
       
  1632         # http://www.cubicweb.org/ticket/1382452
       
  1633         self._test('DISTINCT Any DEP WHERE DEP is Note, P type "cubicweb-foo", P multisource_crossed_rel DEP, DEP type LIKE "cubicweb%"',
       
  1634                    [('FetchStep', [(u'Any DEP WHERE DEP type LIKE "cubicweb%", DEP is Note',
       
  1635                                     [{'DEP': 'Note'}])],
       
  1636                      [self.cards, self.system], None,
       
  1637                      {'DEP': 'table0.C0'},
       
  1638                      []),
       
  1639                     ('FetchStep', [(u'Any P WHERE P type "cubicweb-foo", P is Note', [{'P': 'Note'}])],
       
  1640                      [self.cards, self.system], None, {'P': 'table1.C0'},
       
  1641                      []),
       
  1642                     ('FetchStep', [('Any DEP,P WHERE P multisource_crossed_rel DEP, DEP is Note, P is Note',
       
  1643                                     [{'DEP': 'Note', 'P': 'Note'}])],
       
  1644                      [self.cards, self.system], None, {'DEP': 'table2.C0', 'P': 'table2.C1'},
       
  1645                      []),
       
  1646                     ('OneFetchStep',
       
  1647                      [('DISTINCT Any DEP WHERE P multisource_crossed_rel DEP, DEP is Note, '
       
  1648                        'P is Note, DEP identity A, P identity B, A is Note, B is Note',
       
  1649                        [{u'A': 'Note', u'B': 'Note', 'DEP': 'Note', 'P': 'Note'}])],
       
  1650                      None, None, [self.system],
       
  1651                      {'A': 'table0.C0', 'B': 'table1.C0', 'DEP': 'table2.C0', 'P': 'table2.C1'},
       
  1652                      [])])
  1623 
  1653 
  1624     # edition queries tests ###################################################
  1654     # edition queries tests ###################################################
  1625 
  1655 
  1626     def test_insert_simplified_var_1(self):
  1656     def test_insert_simplified_var_1(self):
  1627         repo._type_source_cache[999999] = ('Note', 'cards', 999999)
  1657         repo._type_source_cache[999999] = ('Note', 'cards', 999999)