Пример #1
0
 def test_add_pgm_manager_to_non_existing_pgm(self):
     self.client.force_login(self.user)
     list_offer_id = []
     pgm_manager_administration.add_program_managers(
         list_offer_id, self.person)
     managers = program_manager.ProgramManager.objects.all()
     self.assertEqual(len(managers), 0)
Пример #2
0
 def test_add_pgm_manager_to_one_pgm(self):
     self.client.force_login(self.user)
     offer_year1 = OfferYearFactory(
         academic_year=self.academic_year_current)
     list_offer_id = [offer_year1]
     pgm_manager_administration.add_program_managers(
         list_offer_id, self.person)
     managers = program_manager.find_by_offer_year_list([offer_year1])
     self.assertEqual(len(managers), 1)
Пример #3
0
    def test_add_program_managers(self):
        offer_year1 = OfferYearFactory(
            academic_year=self.academic_year_current,
            entity_management=self.structure_parent1)
        offer_year2 = OfferYearFactory(
            academic_year=self.academic_year_current,
            entity_management=self.structure_parent1)

        ProgramManagerFactory(person=self.person, offer_year=offer_year1)
        self.assertEqual(
            len(
                pgm_manager_administration.add_program_managers(
                    [offer_year1, offer_year2], self.person)), 1)