Пример #1
0
 def testBadAggregation(self):
     with self.assertRaises(BadValueError):
         ReportColumn.wrap({
             "aggregation": "simple_",
             "field": "doc_id",
             "type": "field",
         })
Пример #2
0
 def from_spec(cls, spec):
     from corehq.apps.userreports.reports.data_source import ConfigurableReportDataSource
     return ConfigurableReportDataSource(
         domain=spec.domain,
         config_or_config_id=spec.config_id,
         filters=[ReportFilter.wrap(f) for f in spec.filters],
         aggregation_columns=spec.aggregation_columns,
         columns=[ReportColumn.wrap(colspec) for colspec in spec.columns],
     )
Пример #3
0
 def testGoodFormat(self):
     for format in [
         'default',
         'percent_of_total',
     ]:
         self.assertEquals(ReportColumn, type(
             ReportColumn.wrap({
                 "aggregation": "simple",
                 "field": "doc_id",
                 "format": format,
                 "type": "field",
             })
         ))