def test_get_config_from_app_bad_names(self, indicators, expected): app = self._get_app() app.domain = "infomovel" self._add_indicators_to_module_details(app.get_module(0), indicators=indicators) config = get_call_center_config_from_app(app) indicators_from_config = get_indicator_slugs_from_config(config) self.assertEqual(sorted(indicators_from_config), expected)
def test_get_config_from_app_bad_names(self, indicators, expected): app = self._get_app() app.domain = 'infomovel' self._add_indicators_to_module_details(app.get_module(0), indicators=indicators) config = get_call_center_config_from_app(app) indicators_from_config = get_indicator_slugs_from_config(config) self.assertEqual(sorted(indicators_from_config), expected)
def test_get_config_from_app(self): app = self._get_app() app.domain = 'aarohi' self._add_indicators_to_module_details(app.get_module(0), self.test_indicators[0:2]) self._add_indicators_to_module_details(app.get_module(1), self.test_indicators[2:4]) forms = list(app.get_forms(bare=True)) self._add_indicators_to_form(forms[2], self.test_indicators[4:]) config = get_call_center_config_from_app(app) indicators_from_config = get_indicator_slugs_from_config(config) expected = self.test_indicators expected = sorted( # these get added becuase legacy indicators just use the date ranges for the # new indicator names expected + ['formsSubmittedMonth1', 'forms_submitted_week0']) self.assertEqual(sorted(indicators_from_config), expected)
def test_get_config_from_app(self): app = self._get_app() app.domain = "aarohi" self._add_indicators_to_module_details(app.get_module(0), self.test_indicators[0:2]) self._add_indicators_to_module_details(app.get_module(1), self.test_indicators[2:4]) forms = list(app.get_forms(bare=True)) self._add_indicators_to_form(forms[2], self.test_indicators[4:]) config = get_call_center_config_from_app(app) indicators_from_config = get_indicator_slugs_from_config(config) expected = self.test_indicators expected = sorted( # these get added becuase legacy indicators just use the date ranges for the # new indicator names expected + ["formsSubmittedMonth1", "forms_submitted_week0"] ) self.assertEqual(sorted(indicators_from_config), expected)