def test_get_scores_encoding_progress_filter_without_attribution(self): progress_list = score_encoding_progress.get_scores_encoding_progress( user=self.program_manager.person.user, offer_year_id=None, number_session=number_session.ONE, academic_year=self.academic_year ) progress_list = score_encoding_progress.group_by_learning_unit_year(progress_list) progress_list = score_encoding_progress.append_related_tutors_and_score_responsibles(progress_list) self.assertEqual(len(progress_list), 2) progress_list = score_encoding_progress.filter_only_without_attribution(progress_list) self.assertEqual(len(progress_list), 1) # LBIR1211 have no score responsible
def test_get_scores_encoding_progress_with_tutors_and_score_responsible(self): # Create tutors test_attribution.create_attribution(tutor=TutorFactory(), learning_unit_year=self.learning_unit_year) test_attribution.create_attribution(tutor=TutorFactory(), learning_unit_year=self.learning_unit_year) progress_list = score_encoding_progress.get_scores_encoding_progress( user=self.program_manager.person.user, offer_year_id=self.offer_year_2, number_session=number_session.ONE, academic_year=self.academic_year ) progress_list = score_encoding_progress.append_related_tutors_and_score_responsibles(progress_list) self.assertEqual(len(progress_list), 1) self.assertEqual(len(progress_list[0].tutors), 3) self.assertEqual(len(progress_list[0].score_responsibles), 1)