def test_get_number_of_report_configs_by_data_source(self): self.assertEqual( get_number_of_report_configs_by_data_source( self.domain_1.name, self.data_source_id), len([report_config for report_config in self.report_configs if report_config.domain == self.domain_1.name and report_config.config_id == self.data_source_id]) )
def get_report_count(self): """ Return the number of ReportConfigurations that reference this data source. """ return get_number_of_report_configs_by_data_source(self.domain, self._id)
def count_by_data_source(cls, domain, data_source_id): return get_number_of_report_configs_by_data_source(domain, data_source_id)