devtools/testlib.py
branchtls-sprint
changeset 1775 f450f1594992
parent 1773 789ee507a8e0
child 1977 606923dff11b
equal deleted inserted replaced
1774:4f4e0c6682e5 1775:f450f1594992
   247     def iter_automatic_rsets(self, limit=10):
   247     def iter_automatic_rsets(self, limit=10):
   248         """generates basic resultsets for each entity type"""
   248         """generates basic resultsets for each entity type"""
   249         etypes = self.to_test_etypes()
   249         etypes = self.to_test_etypes()
   250         for etype in etypes:
   250         for etype in etypes:
   251             yield self.execute('Any X LIMIT %s WHERE X is %s' % (limit, etype))
   251             yield self.execute('Any X LIMIT %s WHERE X is %s' % (limit, etype))
   252 
       
   253         etype1 = etypes.pop()
   252         etype1 = etypes.pop()
   254         etype2 = etypes.pop()
   253         try:
       
   254             etype2 = etypes.pop()
       
   255         except KeyError:
       
   256             etype2 = etype1
   255         # test a mixed query (DISTINCT/GROUP to avoid getting duplicate
   257         # test a mixed query (DISTINCT/GROUP to avoid getting duplicate
   256         # X which make muledit view failing for instance (html validation fails
   258         # X which make muledit view failing for instance (html validation fails
   257         # because of some duplicate "id" attributes)
   259         # because of some duplicate "id" attributes)
   258         yield self.execute('DISTINCT Any X, MAX(Y) GROUPBY X WHERE X is %s, Y is %s' % (etype1, etype2))
   260         yield self.execute('DISTINCT Any X, MAX(Y) GROUPBY X WHERE X is %s, Y is %s' % (etype1, etype2))
   259         # test some application-specific queries if defined
   261         # test some application-specific queries if defined