コード例 #1
0
 def setUp(self):
     super(ScenarioBase2, self).setUp()
     self.indicator.delete()
     self.indicator_ids = instantiate_scenario(self.program.id,
                                               self.scenario)
     self.indicators = Indicator.objects.filter(id__in=self.indicator_ids)
     self.url = reverse_lazy(self.url_name, args=[self.program.id, 0, 0])
     self.response = self.client.get(self.url)
コード例 #2
0
    def setUp(self):
        super(CollectedDataTest, self).setUp()
        core_params = {
            'c_params': [('Country1', 'C1')],
            'p_count': 1,
            'i_count': 2
        }
        self.program_ids, self.indicator_ids = generate_core_indicator_data(
            **core_params)
        program = Program.objects.get(id=self.program_ids[0])
        program.reporting_period_start = datetime.date(2016, 3, 1)
        program.reporting_period_end = datetime.date(2019, 5, 31)
        program.save()
        instantiate_scenario(
            program.id, indicator_scenarios['scenario_2i-default_4pt_3cd'],
            self.indicator_ids)

        self.base_url = 'collected_data_view'
        self.base_args = [0, 0, 0]
コード例 #3
0
 def setUp(self):
     super(ScenarioBase, self).setUp()
     self.indicator.delete()
     indicator_ids = instantiate_scenario(self.program.id, self.scenario)
     if len(indicator_ids) > 1:
         raise ImproperlyConfigured(
             'The scenario contained more than one indicator')
     self.indicators = Indicator.objects.filter(id__in=indicator_ids)
     self.url = reverse_lazy(
         self.url_name, args=[self.indicators.first().id, self.program.id])
     self.response = self.client.get(self.url)