server/test/unittest_msplanner.py
changeset 6225 a176e68b7d0d
parent 6139 f76599a96238
parent 6209 e3e5870807e9
child 6366 1806148d6ce8
equal deleted inserted replaced
6182:30de0be8f895 6225:a176e68b7d0d
    58 X_ALL_SOLS = sorted([{'X': 'Affaire'}, {'X': 'BaseTransition'}, {'X': 'Basket'},
    58 X_ALL_SOLS = sorted([{'X': 'Affaire'}, {'X': 'BaseTransition'}, {'X': 'Basket'},
    59                      {'X': 'Bookmark'}, {'X': 'CWAttribute'}, {'X': 'CWCache'},
    59                      {'X': 'Bookmark'}, {'X': 'CWAttribute'}, {'X': 'CWCache'},
    60                      {'X': 'CWConstraint'}, {'X': 'CWConstraintType'}, {'X': 'CWEType'},
    60                      {'X': 'CWConstraint'}, {'X': 'CWConstraintType'}, {'X': 'CWEType'},
    61                      {'X': 'CWGroup'}, {'X': 'CWPermission'}, {'X': 'CWProperty'},
    61                      {'X': 'CWGroup'}, {'X': 'CWPermission'}, {'X': 'CWProperty'},
    62                      {'X': 'CWRType'}, {'X': 'CWRelation'}, {'X': 'CWUser'},
    62                      {'X': 'CWRType'}, {'X': 'CWRelation'}, {'X': 'CWUser'},
       
    63                      {'X': 'CWUniqueTogetherConstraint'},
    63                      {'X': 'Card'}, {'X': 'Comment'}, {'X': 'Division'},
    64                      {'X': 'Card'}, {'X': 'Comment'}, {'X': 'Division'},
    64                      {'X': 'Email'}, {'X': 'EmailAddress'}, {'X': 'EmailPart'},
    65                      {'X': 'Email'}, {'X': 'EmailAddress'}, {'X': 'EmailPart'},
    65                      {'X': 'EmailThread'}, {'X': 'ExternalUri'}, {'X': 'File'},
    66                      {'X': 'EmailThread'}, {'X': 'ExternalUri'}, {'X': 'File'},
    66                      {'X': 'Folder'}, {'X': 'Note'},
    67                      {'X': 'Folder'}, {'X': 'Note'},
    67                      {'X': 'Personne'}, {'X': 'RQLExpression'}, {'X': 'Societe'},
    68                      {'X': 'Personne'}, {'X': 'RQLExpression'}, {'X': 'Societe'},
   891                         ('UnionFetchStep',
   892                         ('UnionFetchStep',
   892                          [('FetchStep', [('Any X WHERE X is IN(Card, Note, State)',
   893                          [('FetchStep', [('Any X WHERE X is IN(Card, Note, State)',
   893                                           [{'X': 'Card'}, {'X': 'Note'}, {'X': 'State'}])],
   894                                           [{'X': 'Card'}, {'X': 'Note'}, {'X': 'State'}])],
   894                            [self.cards, self.system], {}, {'X': 'table0.C0'}, []),
   895                            [self.cards, self.system], {}, {'X': 'table0.C0'}, []),
   895                           ('FetchStep',
   896                           ('FetchStep',
   896                            [('Any X WHERE X is IN(BaseTransition, Bookmark, CWAttribute, CWCache, CWConstraint, CWConstraintType, CWEType, CWGroup, CWPermission, CWProperty, CWRType, CWRelation, Comment, Division, Email, EmailAddress, EmailPart, EmailThread, ExternalUri, File, Folder, Personne, RQLExpression, Societe, SubDivision, SubWorkflowExitPoint, Tag, TrInfo, Transition, Workflow, WorkflowTransition)',
   897                            [('Any X WHERE X is IN(BaseTransition, Bookmark, CWAttribute, CWCache, CWConstraint, CWConstraintType, CWEType, CWGroup, CWPermission, CWProperty, CWRType, CWRelation, CWUniqueTogetherConstraint, Comment, Division, Email, EmailAddress, EmailPart, EmailThread, ExternalUri, File, Folder, Personne, RQLExpression, Societe, SubDivision, SubWorkflowExitPoint, Tag, TrInfo, Transition, Workflow, WorkflowTransition)',
   897                              [{'X': 'BaseTransition'}, {'X': 'Bookmark'},
   898                              [{'X': 'BaseTransition'}, {'X': 'Bookmark'},
   898                               {'X': 'CWAttribute'}, {'X': 'CWCache'},
   899                               {'X': 'CWAttribute'}, {'X': 'CWCache'},
   899                               {'X': 'CWConstraint'}, {'X': 'CWConstraintType'},
   900                               {'X': 'CWConstraint'}, {'X': 'CWConstraintType'},
   900                               {'X': 'CWEType'}, {'X': 'CWGroup'},
   901                               {'X': 'CWEType'}, {'X': 'CWGroup'},
   901                               {'X': 'CWPermission'}, {'X': 'CWProperty'},
   902                               {'X': 'CWPermission'}, {'X': 'CWProperty'},
   902                               {'X': 'CWRType'}, {'X': 'CWRelation'},
   903                               {'X': 'CWRType'}, {'X': 'CWRelation'},
       
   904                               {'X': 'CWUniqueTogetherConstraint'},
   903                               {'X': 'Comment'}, {'X': 'Division'},
   905                               {'X': 'Comment'}, {'X': 'Division'},
   904                               {'X': 'Email'}, {'X': 'EmailAddress'},
   906                               {'X': 'Email'}, {'X': 'EmailAddress'},
   905                               {'X': 'EmailPart'}, {'X': 'EmailThread'},
   907                               {'X': 'EmailPart'}, {'X': 'EmailThread'},
   906                               {'X': 'ExternalUri'}, {'X': 'File'},
   908                               {'X': 'ExternalUri'}, {'X': 'File'},
   907                               {'X': 'Folder'},
   909                               {'X': 'Folder'},
   952                       ('FetchStep', [('Any ET,X WHERE X is ET, EXISTS(X owned_by 5), ET is CWEType, X is CWUser',
   954                       ('FetchStep', [('Any ET,X WHERE X is ET, EXISTS(X owned_by 5), ET is CWEType, X is CWUser',
   953                                       [{'ET': 'CWEType', 'X': 'CWUser'}])],
   955                                       [{'ET': 'CWEType', 'X': 'CWUser'}])],
   954                        [self.system], {'X': 'table3.C0'}, {'ET': 'table0.C0', 'X': 'table0.C1'}, []),
   956                        [self.system], {'X': 'table3.C0'}, {'ET': 'table0.C0', 'X': 'table0.C1'}, []),
   955                       # extra UnionFetchStep could be avoided but has no cost, so don't care
   957                       # extra UnionFetchStep could be avoided but has no cost, so don't care
   956                       ('UnionFetchStep',
   958                       ('UnionFetchStep',
   957                        [('FetchStep', [('Any ET,X WHERE X is ET, ET is CWEType, X is IN(BaseTransition, Bookmark, CWAttribute, CWCache, CWConstraint, CWConstraintType, CWEType, CWGroup, CWPermission, CWProperty, CWRType, CWRelation, Comment, Division, Email, EmailAddress, EmailPart, EmailThread, ExternalUri, File, Folder, Personne, RQLExpression, Societe, SubDivision, SubWorkflowExitPoint, Tag, TrInfo, Transition, Workflow, WorkflowTransition)',
   959                        [('FetchStep', [('Any ET,X WHERE X is ET, ET is CWEType, X is IN(BaseTransition, Bookmark, CWAttribute, CWCache, CWConstraint, CWConstraintType, CWEType, CWGroup, CWPermission, CWProperty, CWRType, CWRelation, CWUniqueTogetherConstraint, Comment, Division, Email, EmailAddress, EmailPart, EmailThread, ExternalUri, File, Folder, Personne, RQLExpression, Societe, SubDivision, SubWorkflowExitPoint, Tag, TrInfo, Transition, Workflow, WorkflowTransition)',
   958                                         [{'X': 'BaseTransition', 'ET': 'CWEType'},
   960                                         [{'X': 'BaseTransition', 'ET': 'CWEType'},
   959                                          {'X': 'Bookmark', 'ET': 'CWEType'}, {'X': 'CWAttribute', 'ET': 'CWEType'},
   961                                          {'X': 'Bookmark', 'ET': 'CWEType'}, {'X': 'CWAttribute', 'ET': 'CWEType'},
   960                                          {'X': 'CWCache', 'ET': 'CWEType'}, {'X': 'CWConstraint', 'ET': 'CWEType'},
   962                                          {'X': 'CWCache', 'ET': 'CWEType'}, {'X': 'CWConstraint', 'ET': 'CWEType'},
   961                                          {'X': 'CWConstraintType', 'ET': 'CWEType'}, {'X': 'CWEType', 'ET': 'CWEType'},
   963                                          {'X': 'CWConstraintType', 'ET': 'CWEType'}, {'X': 'CWEType', 'ET': 'CWEType'},
   962                                          {'X': 'CWGroup', 'ET': 'CWEType'}, {'X': 'CWPermission', 'ET': 'CWEType'},
   964                                          {'X': 'CWGroup', 'ET': 'CWEType'}, {'X': 'CWPermission', 'ET': 'CWEType'},
   963                                          {'X': 'CWProperty', 'ET': 'CWEType'}, {'X': 'CWRType', 'ET': 'CWEType'},
   965                                          {'X': 'CWProperty', 'ET': 'CWEType'}, {'X': 'CWRType', 'ET': 'CWEType'},
   964                                          {'X': 'CWRelation', 'ET': 'CWEType'}, {'X': 'Comment', 'ET': 'CWEType'},
   966                                          {'X': 'CWRelation', 'ET': 'CWEType'},
       
   967                                          {'X': 'CWUniqueTogetherConstraint', 'ET': 'CWEType'},
       
   968                                          {'X': 'Comment', 'ET': 'CWEType'},
   965                                          {'X': 'Division', 'ET': 'CWEType'}, {'X': 'Email', 'ET': 'CWEType'},
   969                                          {'X': 'Division', 'ET': 'CWEType'}, {'X': 'Email', 'ET': 'CWEType'},
   966                                          {'X': 'EmailAddress', 'ET': 'CWEType'}, {'X': 'EmailPart', 'ET': 'CWEType'},
   970                                          {'X': 'EmailAddress', 'ET': 'CWEType'}, {'X': 'EmailPart', 'ET': 'CWEType'},
   967                                          {'X': 'EmailThread', 'ET': 'CWEType'}, {'X': 'ExternalUri', 'ET': 'CWEType'},
   971                                          {'X': 'EmailThread', 'ET': 'CWEType'}, {'X': 'ExternalUri', 'ET': 'CWEType'},
   968                                          {'X': 'File', 'ET': 'CWEType'}, {'X': 'Folder', 'ET': 'CWEType'},
   972                                          {'X': 'File', 'ET': 'CWEType'}, {'X': 'Folder', 'ET': 'CWEType'},
   969                                          {'X': 'Personne', 'ET': 'CWEType'},
   973                                          {'X': 'Personne', 'ET': 'CWEType'},
  2251                                     [{'X': 'Note'}, {'X': 'State'}, {'X': 'Card'}])],
  2255                                     [{'X': 'Note'}, {'X': 'State'}, {'X': 'Card'}])],
  2252                      [self.cards, self.cards2, self.system],
  2256                      [self.cards, self.cards2, self.system],
  2253                      None, {'X': 'table0.C0'}, []),
  2257                      None, {'X': 'table0.C0'}, []),
  2254                     ('UnionStep', None, None,
  2258                     ('UnionStep', None, None,
  2255                      [('OneFetchStep',
  2259                      [('OneFetchStep',
  2256                        [(u'Any X WHERE X owned_by U, U login "anon", U is CWUser, X is IN(Affaire, BaseTransition, Basket, Bookmark, CWAttribute, CWCache, CWConstraint, CWConstraintType, CWEType, CWGroup, CWPermission, CWProperty, CWRType, CWRelation, CWUser, Division, Email, EmailAddress, EmailPart, EmailThread, ExternalUri, File, Folder, Personne, RQLExpression, Societe, SubDivision, SubWorkflowExitPoint, Tag, TrInfo, Transition, Workflow, WorkflowTransition)',
  2260                        [(u'Any X WHERE X owned_by U, U login "anon", U is CWUser, X is IN(Affaire, BaseTransition, Basket, Bookmark, CWAttribute, CWCache, CWConstraint, CWConstraintType, CWEType, CWGroup, CWPermission, CWProperty, CWRType, CWRelation, CWUniqueTogetherConstraint, CWUser, Division, Email, EmailAddress, EmailPart, EmailThread, ExternalUri, File, Folder, Personne, RQLExpression, Societe, SubDivision, SubWorkflowExitPoint, Tag, TrInfo, Transition, Workflow, WorkflowTransition)',
  2257                          [{'U': 'CWUser', 'X': 'Affaire'},
  2261                          [{'U': 'CWUser', 'X': 'Affaire'},
  2258                           {'U': 'CWUser', 'X': 'BaseTransition'},
  2262                           {'U': 'CWUser', 'X': 'BaseTransition'},
  2259                           {'U': 'CWUser', 'X': 'Basket'},
  2263                           {'U': 'CWUser', 'X': 'Basket'},
  2260                           {'U': 'CWUser', 'X': 'Bookmark'},
  2264                           {'U': 'CWUser', 'X': 'Bookmark'},
  2261                           {'U': 'CWUser', 'X': 'CWAttribute'},
  2265                           {'U': 'CWUser', 'X': 'CWAttribute'},
  2266                           {'U': 'CWUser', 'X': 'CWGroup'},
  2270                           {'U': 'CWUser', 'X': 'CWGroup'},
  2267                           {'U': 'CWUser', 'X': 'CWPermission'},
  2271                           {'U': 'CWUser', 'X': 'CWPermission'},
  2268                           {'U': 'CWUser', 'X': 'CWProperty'},
  2272                           {'U': 'CWUser', 'X': 'CWProperty'},
  2269                           {'U': 'CWUser', 'X': 'CWRType'},
  2273                           {'U': 'CWUser', 'X': 'CWRType'},
  2270                           {'U': 'CWUser', 'X': 'CWRelation'},
  2274                           {'U': 'CWUser', 'X': 'CWRelation'},
       
  2275                           {'U': 'CWUser', 'X': 'CWUniqueTogetherConstraint'},
  2271                           {'U': 'CWUser', 'X': 'CWUser'},
  2276                           {'U': 'CWUser', 'X': 'CWUser'},
  2272                           {'U': 'CWUser', 'X': 'Division'},
  2277                           {'U': 'CWUser', 'X': 'Division'},
  2273                           {'U': 'CWUser', 'X': 'Email'},
  2278                           {'U': 'CWUser', 'X': 'Email'},
  2274                           {'U': 'CWUser', 'X': 'EmailAddress'},
  2279                           {'U': 'CWUser', 'X': 'EmailAddress'},
  2275                           {'U': 'CWUser', 'X': 'EmailPart'},
  2280                           {'U': 'CWUser', 'X': 'EmailPart'},