def setUp(self): """ Populates the test database and sets up the expected django models for django_tables_2 for the tests to compare against """ views.testing = True super(ExperimentSearchTestCase, self).setUp() test_db_setup.set_up_test_db() # Finds the experiment document db ids to build the ExperimentForTables' download links with switch_db(Experiment, TEST_DB_ALIAS) as TestEx: experi = TestEx.objects.get(name=expected_experi_model.name) self.expected_experi_model_id = experi.id expected_table_experi.download_link = "download/" + str( experi.id) + "/" unexperi_1 = TestEx.objects.get( name=unexpected_experi_model_1.name) self.unexpected_experi_model_1_id = unexperi_1.id unexpected_table_experi_1.download_link = "download/" + str( unexperi_1.id) + "/" unexperi_2 = TestEx.objects.get( name=unexpected_experi_model_2.name) self.unexpected_experi_model_2_id = unexperi_2.id unexpected_table_experi_2.download_link = "download/" + str( unexperi_2.id) + "/" unexperi_3 = TestEx.objects.get( name=unexpected_experi_model_3.name) self.unexpected_experi_model_3_id = unexperi_3.id unexpected_table_experi_3.download_link = "download/" + str( unexperi_3.id) + "/"
def setUp(self): """ Populates the test database and sets up the expected django models for django_tables_2 for the tests to compare against """ views.testing = True super(ExperimentSearchTestCase, self).setUp() test_db_setup.set_up_test_db() # Finds the experiment document db ids to build the ExperimentForTables' download links with switch_db(Experiment, TEST_DB_ALIAS) as TestEx: experi = TestEx.objects.get(name=expected_experi_model.name) self.expected_experi_model_id = experi.id expected_table_experi.download_link = "download/" + str(experi.id) + "/" unexperi_1 = TestEx.objects.get(name=unexpected_experi_model_1.name) self.unexpected_experi_model_1_id = unexperi_1.id unexpected_table_experi_1.download_link = "download/" + str(unexperi_1.id) + "/" unexperi_2 = TestEx.objects.get(name=unexpected_experi_model_2.name) self.unexpected_experi_model_2_id = unexperi_2.id unexpected_table_experi_2.download_link = "download/" + str(unexperi_2.id) + "/" unexperi_3 = TestEx.objects.get(name=unexpected_experi_model_3.name) self.unexpected_experi_model_3_id = unexperi_3.id unexpected_table_experi_3.download_link = "download/" + str(unexperi_3.id) + "/"
def setUp(self): views.testing = True super(ReportTestCase, self).setUp() test_db_setup.set_up_test_db()