test/unittest_schema.py
changeset 10192 365e5a0287d6
parent 9990 c84ad981fc4a
child 10193 a0a11be5a9cb
equal deleted inserted replaced
10191:cc4b8021bdf3 10192:365e5a0287d6
   296 
   296 
   297         class Company(EntityType):
   297         class Company(EntityType):
   298             total_salary = Int(formula='Any SUM(SA) GROUPBY X WHERE '
   298             total_salary = Int(formula='Any SUM(SA) GROUPBY X WHERE '
   299                                        'P works_for X, P salary SA')
   299                                        'P works_for X, P salary SA')
   300         good_schema = build_schema_from_namespace(vars().items())
   300         good_schema = build_schema_from_namespace(vars().items())
       
   301 
       
   302         # ensure 'X is Company' is added to the rqlst to avoid ambiguities, see #4901163
       
   303         self.assertEqual(str(good_schema['Company'].rdef('total_salary').formula_select),
       
   304                          'Any SUM(SA) GROUPBY X WHERE P works_for X, P salary SA, X is Company')
   301 
   305 
   302         class Company(EntityType):
   306         class Company(EntityType):
   303             total_salary = String(formula='Any SUM(SA) GROUPBY X WHERE '
   307             total_salary = String(formula='Any SUM(SA) GROUPBY X WHERE '
   304                                           'P works_for X, P salary SA')
   308                                           'P works_for X, P salary SA')
   305 
   309