Exemplo n.º 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])
Exemplo n.º 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)
Exemplo n.º 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])
Exemplo n.º 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)