Пример #1
0
 def test_that_the_years_are_returned_sorted_in_asc_order(self):
     Data_Set.objects.create(indicator=self.h1, year=2014)
     Data_Set.objects.create(indicator=self.h1, year=2017)
     Data_Set.objects.create(indicator=self.h1, year=2016)
     Data_Set.objects.create(indicator=self.h1, year=2018)
     years = dataSetYearsForIndicator('Obisity')
     self.assertEqual(years, [2014, 2016, 2017, 2018])
Пример #2
0
 def test_that_one_kpi_can_have_multiple_years(self):
     Data_Set.objects.create(indicator=self.h1, year=2014)
     Data_Set.objects.create(indicator=self.h1, year=2017)
     Data_Set.objects.create(indicator=self.h1, year=2016)
     Data_Set.objects.create(indicator=self.h1, year=2018)
     years = dataSetYearsForIndicator('Obisity')
     self.assertEqual(len(years), 4)
Пример #3
0
 def test_if_the_current_year_in_the_database_for_obisity_is_2014(self):
     Data_Set.objects.create(indicator=self.h1, year=2014)
     years = dataSetYearsForIndicator('Obisity')
     self.assertEqual(years, [2014])
Пример #4
0
 def test_that_number_of_year_count_for_obisity_is_one_returned(self):
     Data_Set.objects.create(indicator=self.h1, year=2014)
     years = dataSetYearsForIndicator('Obisity')
     self.assertEqual(len(years), 1)