Example #1
0
 def test_add_training_data(self):
     formations = _add_training_data(self.learning_unit_yr_1)
     expected = " {} ({}) - {} - {}\n".format(self.an_education_group_parent.partial_acronym,
                                              "{0:.2f}".format(self.learning_unit_yr_1.credits),
                                              PARENT_ACRONYM,
                                              PARENT_TITLE)
     self.assertEqual(formations, expected)
 def test_add_training_data(self):
     luy_1 = LearningUnitYear.objects.filter(pk=self.learning_unit_yr_1.pk).annotate(
         closest_trainings=RawSQL(SQL_RECURSIVE_QUERY_EDUCATION_GROUP_TO_CLOSEST_TRAININGS, ())
     ).get()
     formations = _add_training_data(luy_1)
     expected = "{} ({}) - {} - {}\n".format(self.an_education_group_parent.partial_acronym,
                                             "{0:.2f}".format(luy_1.credits),
                                             self.an_education_group_parent.acronym,
                                             self.an_education_group_parent.title)
     self.assertEqual(formations, expected)