server/test/unittest_querier.py
changeset 8111 d1be698018d2
parent 8021 25fbfd84529f
child 8127 96d343a5e01b
equal deleted inserted replaced
8110:d743865ba7ed 8111:d1be698018d2
   143                                        'I': 'Affaire',
   143                                        'I': 'Affaire',
   144                                        'J': 'Affaire',
   144                                        'J': 'Affaire',
   145                                        'X': 'Affaire',
   145                                        'X': 'Affaire',
   146                                        'ET': 'CWEType', 'ETN': 'String'}])
   146                                        'ET': 'CWEType', 'ETN': 'String'}])
   147         rql, solutions = partrqls[1]
   147         rql, solutions = partrqls[1]
   148         self.assertEqual(rql,  'Any ETN,X WHERE X is ET, ET name ETN, ET is CWEType, X is IN(BaseTransition, Bookmark, CWAttribute, CWCache, CWConstraint, CWConstraintType, CWEType, CWGroup, CWPermission, CWProperty, CWRType, CWRelation, CWSource, CWUniqueTogetherConstraint, CWUser, Card, Comment, Division, Email, EmailAddress, EmailPart, EmailThread, ExternalUri, File, Folder, Note, Personne, RQLExpression, Societe, State, SubDivision, SubWorkflowExitPoint, Tag, TrInfo, Transition, Workflow, WorkflowTransition)')
   148         self.assertEqual(rql,  'Any ETN,X WHERE X is ET, ET name ETN, ET is CWEType, X is IN(BaseTransition, Bookmark, CWAttribute, CWCache, CWConstraint, CWConstraintType, CWEType, CWGroup, CWPermission, CWProperty, CWRType, CWRelation, CWSource, CWUniqueTogetherConstraint, CWUser, Card, Comment, Division, Email, EmailAddress, EmailPart, EmailThread, ExternalUri, File, Folder, Note, Old, Personne, RQLExpression, Societe, State, SubDivision, SubWorkflowExitPoint, Tag, TrInfo, Transition, Workflow, WorkflowTransition)')
   149         self.assertListEqual(sorted(solutions),
   149         self.assertListEqual(sorted(solutions),
   150                               sorted([{'X': 'BaseTransition', 'ETN': 'String', 'ET': 'CWEType'},
   150                               sorted([{'X': 'BaseTransition', 'ETN': 'String', 'ET': 'CWEType'},
   151                                       {'X': 'Bookmark', 'ETN': 'String', 'ET': 'CWEType'},
   151                                       {'X': 'Bookmark', 'ETN': 'String', 'ET': 'CWEType'},
   152                                       {'X': 'Card', 'ETN': 'String', 'ET': 'CWEType'},
   152                                       {'X': 'Card', 'ETN': 'String', 'ET': 'CWEType'},
   153                                       {'X': 'Comment', 'ETN': 'String', 'ET': 'CWEType'},
   153                                       {'X': 'Comment', 'ETN': 'String', 'ET': 'CWEType'},
   171                                       {'X': 'EmailThread', 'ETN': 'String', 'ET': 'CWEType'},
   171                                       {'X': 'EmailThread', 'ETN': 'String', 'ET': 'CWEType'},
   172                                       {'X': 'ExternalUri', 'ETN': 'String', 'ET': 'CWEType'},
   172                                       {'X': 'ExternalUri', 'ETN': 'String', 'ET': 'CWEType'},
   173                                       {'X': 'File', 'ETN': 'String', 'ET': 'CWEType'},
   173                                       {'X': 'File', 'ETN': 'String', 'ET': 'CWEType'},
   174                                       {'X': 'Folder', 'ETN': 'String', 'ET': 'CWEType'},
   174                                       {'X': 'Folder', 'ETN': 'String', 'ET': 'CWEType'},
   175                                       {'X': 'Note', 'ETN': 'String', 'ET': 'CWEType'},
   175                                       {'X': 'Note', 'ETN': 'String', 'ET': 'CWEType'},
       
   176                                       {'X': 'Old', 'ETN': 'String', 'ET': 'CWEType'},
   176                                       {'X': 'Personne', 'ETN': 'String', 'ET': 'CWEType'},
   177                                       {'X': 'Personne', 'ETN': 'String', 'ET': 'CWEType'},
   177                                       {'X': 'RQLExpression', 'ETN': 'String', 'ET': 'CWEType'},
   178                                       {'X': 'RQLExpression', 'ETN': 'String', 'ET': 'CWEType'},
   178                                       {'X': 'Societe', 'ETN': 'String', 'ET': 'CWEType'},
   179                                       {'X': 'Societe', 'ETN': 'String', 'ET': 'CWEType'},
   179                                       {'X': 'State', 'ETN': 'String', 'ET': 'CWEType'},
   180                                       {'X': 'State', 'ETN': 'String', 'ET': 'CWEType'},
   180                                       {'X': 'SubDivision', 'ETN': 'String', 'ET': 'CWEType'},
   181                                       {'X': 'SubDivision', 'ETN': 'String', 'ET': 'CWEType'},
   526                             'WHERE RT name N, RDEF relation_type RT '
   527                             'WHERE RT name N, RDEF relation_type RT '
   527                             'HAVING COUNT(RDEF) > 10')
   528                             'HAVING COUNT(RDEF) > 10')
   528         self.assertListEqual(rset.rows,
   529         self.assertListEqual(rset.rows,
   529                               [[u'description_format', 12],
   530                               [[u'description_format', 12],
   530                                [u'description', 13],
   531                                [u'description', 13],
   531                                [u'name', 15],
   532                                [u'name', 16],
   532                                [u'created_by', 42],
   533                                [u'created_by', 43],
   533                                [u'creation_date', 42],
   534                                [u'creation_date', 43],
   534                                [u'cw_source', 42],
   535                                [u'cw_source', 43],
   535                                [u'cwuri', 42],
   536                                [u'cwuri', 43],
   536                                [u'in_basket', 42],
   537                                [u'in_basket', 43],
   537                                [u'is', 42],
   538                                [u'is', 43],
   538                                [u'is_instance_of', 42],
   539                                [u'is_instance_of', 43],
   539                                [u'modification_date', 42],
   540                                [u'modification_date', 43],
   540                                [u'owned_by', 42]])
   541                                [u'owned_by', 43]])
   541 
   542 
   542     def test_select_aggregat_having_dumb(self):
   543     def test_select_aggregat_having_dumb(self):
   543         # dumb but should not raise an error
   544         # dumb but should not raise an error
   544         rset = self.execute('Any U,COUNT(X) GROUPBY U '
   545         rset = self.execute('Any U,COUNT(X) GROUPBY U '
   545                             'WHERE U eid %(x)s, X owned_by U '
   546                             'WHERE U eid %(x)s, X owned_by U '