def setUp(self): """Setup for testing""" celery_app.conf.CELERY_ALWAYS_EAGER = True db_util.insert_calculation_parameters(self.db_session) db_util.insert_codes(self.db_session) db_util.insert_locations(self.db_session) db_util.insert_cases(self.db_session, "public_health_report", delete=True) db_util.insert_cases(self.db_session, "ncd_public_health_report", delete=False) db_util.insert_cases(self.db_session, "ncd_report", delete=False) db_util.insert_cases(self.db_session, "pip_report", delete=False) db_util.insert_cases(self.db_session, "refugee_data", delete=False) db_util.insert_cases(self.db_session, "frontpage", delete=False) db_util.insert_cases(self.db_session, "map_test", delete=False) db_util.insert_cases(self.db_session, "epi_monitoring", delete=False) db_util.insert_cases(self.db_session, "malaria", delete=False) db_util.insert_cases(self.db_session, "alerts", delete=False) db_util.insert_cases(self.db_session, "cd_report", delete=False) db_util.insert_cases(self.db_session, "vaccination_report", delete=False) db_util.insert_cases(self.db_session, "completeness", delete=False) db_util.insert_cases(self.db_session, "oms_report", delete=False) db_util.insert_cases(self.db_session, "mental_health", delete=False) self.locations = {1: {"name": "Demo"}} self.variables = {1: {"name": "Total"}}
def setUp(self): """Setup for testing""" self._mock_epi_week_abacus_logic() db_util.insert_codes(self.db_session) db_util.insert_locations(self.db_session) db_util.insert_cases(self.db_session, "public_health_report") pseudo_db = namedtuple("pseudo_db", ["session", "engine"]) self.db = pseudo_db(session=self.db_session, engine=db_util.engine)
def setUp(self): """Setup for testing""" meerkat_api.app.config['TESTING'] = True meerkat_api.app.config['API_KEY'] = "" self.app = meerkat_api.app.test_client() session = db_util.session db_util.insert_codes(session) db_util.insert_locations(session)
def setUp(self): """Setup for testing""" meerkat_api.app.config['TESTING'] = True meerkat_api.app.config['API_KEY'] = "should-work-even-with-api-key" self.app = meerkat_api.app.test_client() session = db_util.session db_util.insert_codes(session) db_util.insert_locations(session) db_util.insert_cases(session, "frontpage", "2016-07-02") self.session = session
def setUp(self): """Setup for testing""" meerkat_api.app.config['TESTING'] = True meerkat_api.app.config['API_KEY'] = "" celery_app.conf.CELERY_ALWAYS_EAGER = True self.app = meerkat_api.app.test_client() self.session = db_util.session for table in model.form_tables(): self.session.query(model.form_tables()[table]).delete() self.session.query(model.Locations).delete() self.session.commit() db_util.insert_codes(self.session) db_util.insert_locations(self.session) db_util.insert_cases(self.session, "public_health_report") current_directory = os.path.dirname(__file__) form_data = [] for d in util.read_csv(current_directory + "/test_data/" + "demo_case.csv"): form_data.append(d) data_import.add_rows_to_db( "demo_case", form_data, db_util.session, db_util.engine, deviceids=["1", "2", "3", "4", "5", "6"], ) dr_name = config.country_config["tables"][1] form_data = [] for d in util.read_csv(current_directory + "/test_data/" + "demo_alert.csv"): form_data.append(d) data_import.add_rows_to_db("demo_alert", form_data, db_util.session, db_util.engine, deviceids=["1", "2", "3", "4", "5", "6"])
def setUp(self): """Setup for testing""" self._mock_epi_week_abacus_logic() db_util.insert_codes(self.db_session) db_util.insert_locations(self.db_session, date="2016-07-02")
def setUp(self): """Setup for testing""" self._mock_epi_week_abacus_logic() db_util.insert_codes(self.db_session) db_util.insert_locations(self.db_session) db_util.insert_cases(self.db_session, "public_health_report")