server/test/unittest_msplanner.py
branchstable
changeset 7188 b2c45b7396fb
parent 7108 bcdf22734059
child 7189 0c2c41fcb89d
equal deleted inserted replaced
7186:287f2273917f 7188:b2c45b7396fb
  2381                    [('OneFetchStep', [('Any 999999 WHERE O use_email 999999, ((EXISTS(O identity 999998)) OR (EXISTS(O in_group G, G name IN("managers", "staff")))) OR (EXISTS(O in_group G2, 999998 in_group G2, NOT G2 name "users"))',
  2381                    [('OneFetchStep', [('Any 999999 WHERE O use_email 999999, ((EXISTS(O identity 999998)) OR (EXISTS(O in_group G, G name IN("managers", "staff")))) OR (EXISTS(O in_group G2, 999998 in_group G2, NOT G2 name "users"))',
  2382                                        [{'G': 'CWGroup', 'G2': 'CWGroup', 'O': 'CWUser'}])],
  2382                                        [{'G': 'CWGroup', 'G2': 'CWGroup', 'O': 'CWUser'}])],
  2383                      None, None, [self.system], {}, [])],
  2383                      None, None, [self.system], {}, [])],
  2384                    {'x': 999999, 'u': 999998})
  2384                    {'x': 999999, 'u': 999998})
  2385 
  2385 
       
  2386     def test_nonregr_similar_subquery(self):
       
  2387         repo._type_source_cache[999999] = ('Personne', 'system', 999999)
       
  2388         self._test('Any T,TD,U,T,UL WITH T,TD,U,UL BEING ('
       
  2389                    '(Any T,TD,U,UL WHERE X eid %(x)s, T comments X, T content TD, T created_by U?, U login UL)'
       
  2390                    ' UNION '
       
  2391                    '(Any T,TD,U,UL WHERE X eid %(x)s, X connait P, T comments P, T content TD, T created_by U?, U login UL))',
       
  2392                    # XXX optimization: use a OneFetchStep with a UNION of both queries
       
  2393                    [('FetchStep', [('Any U,UL WHERE U login UL, U is CWUser',
       
  2394                                     [{'U': 'CWUser', 'UL': 'String'}])],
       
  2395                      [self.ldap, self.system], None,
       
  2396                      {'U': 'table0.C0', 'U.login': 'table0.C1', 'UL': 'table0.C1'},
       
  2397                      []),
       
  2398                     ('UnionFetchStep',
       
  2399                      [('FetchStep',
       
  2400                        [('Any T,TD,U,UL WHERE T comments 999999, T content TD, T created_by U?, U login UL, T is Comment, U is CWUser',
       
  2401                          [{'T': 'Comment', 'TD': 'String', 'U': 'CWUser', 'UL': 'String'}])],
       
  2402                        [self.system],
       
  2403                        {'U': 'table0.C0', 'U.login': 'table0.C1', 'UL': 'table0.C1'},
       
  2404                        {'T': 'table1.C0',
       
  2405                         'T.content': 'table1.C1',
       
  2406                         'TD': 'table1.C1',
       
  2407                         'U': 'table1.C2',
       
  2408                         'U.login': 'table1.C3',
       
  2409                         'UL': 'table1.C3'},
       
  2410                        []),
       
  2411                       ('FetchStep',
       
  2412                        [('Any T,TD,U,UL WHERE 999999 connait P, T comments P, T content TD, T created_by U?, U login UL, P is Personne, T is Comment, U is CWUser',
       
  2413                          [{'P': 'Personne',
       
  2414                            'T': 'Comment',
       
  2415                            'TD': 'String',
       
  2416                            'U': 'CWUser',
       
  2417                            'UL': 'String'}])],
       
  2418                        [self.system],
       
  2419                        {'U': 'table0.C0', 'U.login': 'table0.C1', 'UL': 'table0.C1'},
       
  2420                        {'T': 'table1.C0',
       
  2421                         'T.content': 'table1.C1',
       
  2422                         'TD': 'table1.C1',
       
  2423                         'U': 'table1.C2',
       
  2424                         'U.login': 'table1.C3',
       
  2425                         'UL': 'table1.C3'},
       
  2426                        [])]),
       
  2427                     ('OneFetchStep',
       
  2428                      [('Any T,TD,U,T,UL',
       
  2429                        [{'T': 'Comment', 'TD': 'String', 'U': 'CWUser', 'UL': 'String'}])],
       
  2430                      None, None,
       
  2431                      [self.system],
       
  2432                      {'T': 'table1.C0', 'TD': 'table1.C1', 'U': 'table1.C2', 'UL': 'table1.C3'},
       
  2433                      [])],
       
  2434                    {'x': 999999})
       
  2435 
  2386 
  2436 
  2387 class MSPlannerTwoSameExternalSourcesTC(BasePlannerTC):
  2437 class MSPlannerTwoSameExternalSourcesTC(BasePlannerTC):
  2388     """test planner related feature on a 3-sources repository:
  2438     """test planner related feature on a 3-sources repository:
  2389 
  2439 
  2390     * 2 rql sources supporting Card
  2440     * 2 rql sources supporting Card