コード例 #1
0
    def setUp(self):
        AcademicYearFactory.produce_in_past()

        self.current_academic_yr = academic_year.current_academic_year()

        self.academic_calendar_1 = AcademicCalendarFactory.build(
            title="Submission of score encoding - 1",
            start_date=datetime.date(self.current_academic_yr.year, 10, 15),
            end_date=datetime.date(self.current_academic_yr.year + 1, 1, 1),
            academic_year=self.current_academic_yr,
            reference=academic_calendar_type.SCORES_EXAM_SUBMISSION)
        self.academic_calendar_2 = AcademicCalendarFactory.build(
            title="Submission of score encoding - 2",
            start_date=datetime.date(self.current_academic_yr.year + 1, 3, 15),
            end_date=datetime.date(self.current_academic_yr.year + 1, 6, 28),
            academic_year=self.current_academic_yr,
            reference=academic_calendar_type.SCORES_EXAM_SUBMISSION)
        self.academic_calendar_3 = AcademicCalendarFactory.build(
            title="Submission of score encoding - 3",
            start_date=datetime.date(self.current_academic_yr.year + 1, 8, 1),
            end_date=datetime.date(self.current_academic_yr.year + 1, 9, 29),
            academic_year=self.current_academic_yr,
            reference=academic_calendar_type.SCORES_EXAM_SUBMISSION)
        self.academic_calendar_4 = AcademicCalendarFactory.build(
            title="Deliberation session 1",
            start_date=datetime.date(self.current_academic_yr.year + 1, 1, 1),
            end_date=datetime.date(self.current_academic_yr.year + 1, 1, 2),
            academic_year=self.current_academic_yr,
            reference=academic_calendar_type.DELIBERATION)
        self.academic_calendar_1.save(functions=[])
        self.academic_calendar_2.save(functions=[])
        self.academic_calendar_3.save(functions=[])
        self.academic_calendar_4.save(functions=[])
コード例 #2
0
    def setUp(self):
        AcademicYearFactory.produce_in_past()

        self.current_academic_yr = academic_year.current_academic_year()
        self.academic_calendar = AcademicCalendarFactory(title="Deliberation session 1",
                                                         start_date=datetime.date(self.current_academic_yr.year+1, 1, 1),
                                                         end_date=datetime.date(self.current_academic_yr.year+1, 1, 2),
                                                         academic_year=self.current_academic_yr,
                                                         reference=academic_calendar_type.DELIBERATION)
        SessionExamCalendarFactory(academic_calendar=self.academic_calendar,
                                   number_session=number_session.ONE)
        self.offer_yr = OfferYearFactory(academic_year=self.current_academic_yr)
コード例 #3
0
 def setUp(self):
     self.client = Client()
     self.request = self.client.post('/assistants/manager/mandates/upload/')
     self.request._messages = FakeMessages()
     self.manager = ManagerFactory()
     self.client.force_login(self.manager.person.user)
     self.request.user = self.manager.person.user
     now = timezone.now()
     AcademicYearFactory.produce_in_past()
     self.previous_academic_year = academic_year.find_academic_year_by_year(now.year - 2)
     self.person1 = PersonFactory(global_id='00201968')
     self.assistant1 = AcademicAssistantFactory(person=self.person1)
     self.record1 = {
         'SECTOR': 'SST', 'LOGISTICS_ENTITY': 'None', 'FACULTY': 'SC', 'SCHOOL': 'CHIM', 'INSTITUTE': 'IMCN',
         'POLE': 'MOST', 'SAP_ID': '1122199', 'GLOBAL_ID': '1122199', 'LAST_NAME': self.assistant1.person.last_name,
         'FIRST_NAME': self.assistant1.person.first_name, 'FULLTIME_EQUIVALENT': '1', 'ENTRY_DATE': '01/02/2015',
         'END_DATE': '03-10-2017', 'ASSISTANT_TYPE_CODE': 'ST', 'SCALE': '021', 'CONTRACT_DURATION': '4',
         'CONTRACT_DURATION_FTE': '4', 'RENEWAL_TYPE': 'NORMAL', 'ABSENCES': None, 'COMMENT': None,
         'OTHER_STATUS': None, 'EMAIL': None, 'FGS': '00201968'
     }
     self.person2 = PersonFactory(global_id='00201979')
     self.assistant2 = AcademicAssistantFactory()
     self.record2 = {
         'SECTOR': 'SST', 'LOGISTICS_ENTITY': 'None', 'FACULTY': 'SC', 'SCHOOL': 'CHIM', 'INSTITUTE': 'IMCN',
         'POLE': 'MOST', 'SAP_ID': '1122199', 'GLOBAL_ID': '1122199', 'LAST_NAME': self.person2.last_name,
         'FIRST_NAME': self.person2.first_name, 'FULLTIME_EQUIVALENT': '1', 'ENTRY_DATE': '01/02/2015',
         'END_DATE': '03-10-2017', 'ASSISTANT_TYPE_CODE': 'AS', 'SCALE': '021', 'CONTRACT_DURATION': '4',
         'CONTRACT_DURATION_FTE': '4', 'RENEWAL_TYPE': 'exceptional', 'ABSENCES': None, 'COMMENT': None,
         'OTHER_STATUS': None, 'EMAIL': None, 'FGS': '00201979'
     }
     self.assistant3 = AcademicAssistantFactory()
     self.record3 = {
         'SECTOR': 'SST', 'LOGISTICS_ENTITY': 'None', 'FACULTY': 'SC', 'SCHOOL': 'CHIM', 'INSTITUTE': 'IMCN',
         'POLE': 'MOST', 'SAP_ID': '1122599', 'GLOBAL_ID': '1322199', 'LAST_NAME': 'last_name',
         'FIRST_NAME': 'first_name', 'FULLTIME_EQUIVALENT': '1', 'ENTRY_DATE': '01/02/2015',
         'END_DATE': '03-10-2017', 'ASSISTANT_TYPE_CODE': 'AS', 'SCALE': '021', 'CONTRACT_DURATION': '4',
         'CONTRACT_DURATION_FTE': '4', 'RENEWAL_TYPE': 'SPECIAL', 'ABSENCES': None, 'COMMENT': None,
         'OTHER_STATUS': None, 'EMAIL': None, 'FGS': None
     }
     self.entity_version1 = EntityVersionFactory(entity_type=entity_type.SECTOR,
                                                 acronym='SST',
                                                 title='Secteur des Sciences et Technologies',
                                                 end_date=datetime.datetime(datetime.date.today().year + 1, 9, 14))
     self.entity_version2 = EntityVersionFactory(entity_type=entity_type.SECTOR,
                                                 acronym='SSH',
                                                 end_date=datetime.datetime(datetime.date.today().year + 1, 9, 14))
     self.assistant_mandate1 = AssistantMandateFactory(
         assistant=self.assistant1
     )
コード例 #4
0
    def setUpTestData(cls):
        cls.person = PersonFactory()
        cls.user = cls.person.user
        cls.tutor = TutorFactory(person=cls.person)
        cls.current_ac_year = create_current_academic_year()
        ac_year_in_past = AcademicYearFactory.produce_in_past(
            cls.current_ac_year.year)
        cls.ac_year_in_future = AcademicYearFactory.produce_in_future(
            cls.current_ac_year.year)

        cls.academic_calendar = OpenAcademicCalendarFactory(
            academic_year=cls.current_ac_year,
            data_year=cls.current_ac_year,
            reference=academic_calendar_type.SUMMARY_COURSE_SUBMISSION)
        requirement_entity = EntityVersionFactory().entity
        # Create multiple attribution in different academic years
        for ac_year in ac_year_in_past + [cls.current_ac_year
                                          ] + cls.ac_year_in_future:
            learning_container_year = LearningContainerYearFactory(
                academic_year=ac_year, requirement_entity=requirement_entity)
            learning_unit_year = LearningUnitYearFactory(
                summary_locked=False,
                academic_year=ac_year,
                learning_container_year=learning_container_year)
            AttributionFactory(
                tutor=cls.tutor,
                summary_responsible=True,
                learning_unit_year=learning_unit_year,
            )
        cls.url = reverse(list_my_attributions_summary_editable)
コード例 #5
0
    def setUpTestData(cls):
        ProgramManagerGroupFactory()
        group = EntityManagerGroupFactory()
        group.permissions.add(
            Permission.objects.get(codename='view_programmanager'))
        group.permissions.add(
            Permission.objects.get(codename='change_programmanager'))

        # FIXME: Old structure model [To remove]
        cls.structure_parent1 = StructureFactory(acronym='SSH')
        cls.structure_child1 = StructureFactory(acronym='TECO',
                                                part_of=cls.structure_parent1)
        cls.structure_child11 = StructureFactory(acronym='TEBI',
                                                 part_of=cls.structure_child1)
        cls.structure_child2 = StructureFactory(acronym='ESPO',
                                                part_of=cls.structure_parent1)
        cls.structure_child21 = StructureFactory(acronym='ECON',
                                                 part_of=cls.structure_child2)
        cls.structure_child22 = StructureFactory(acronym='COMU',
                                                 part_of=cls.structure_child2)

        cls.entity_manager = EntityManagerFactory(
            structure=cls.structure_parent1)
        cls.academic_year_previous, cls.academic_year_current = AcademicYearFactory.produce_in_past(
            quantity=2)
        cls.person = PersonFactory()
コード例 #6
0
 def setUpTestData(cls):
     cls.current_acy, cls.previous_acy = AcademicYearFactory.produce_in_past(
         from_year=2019, quantity=2)
     cls.group_element_year = GroupElementYearFactory(
         parent=TrainingFactory(academic_year=cls.current_acy),
         child_branch=MiniTrainingFactory(academic_year=cls.current_acy),
     )
     cls.faculty_manager = FacultyManagerFactory()
     cls.faculty_manager.user.user_permissions.add(
         Permission.objects.get(codename="change_educationgroup"))
     PersonEntityFactory(
         entity=cls.group_element_year.parent.management_entity,
         person=cls.faculty_manager)
コード例 #7
0
ファイル: test_perms.py プロジェクト: allouchmed/osis
 def setUpTestData(cls):
     cls.current_acy, cls.previous_acy = AcademicYearFactory.produce_in_past(
         from_year=2019, quantity=2)
     cls.group_element_year = GroupElementYearFactory(
         parent=TrainingFactory(academic_year=cls.current_acy),
         child_branch=MiniTrainingFactory(
             academic_year=cls.current_acy,
             education_group_type__name=MiniTrainingType.DEEPENING.name),
     )
     cls.faculty_manager = FacultyManagerFactory(
         'change_educationgroup', 'change_educationgroupcontent')
     PersonEntityFactory(
         entity=cls.group_element_year.parent.management_entity,
         person=cls.faculty_manager)
コード例 #8
0
    def setUpTestData(cls):
        AcademicYearFactory.produce_in_past()

        cls.current_academic_yr = academic_year.current_academic_year()

        cls.academic_calendar_2 = AcademicCalendarFactory(
            title="Submission of score encoding - 2",
            start_date=datetime.date(cls.current_academic_yr.year + 1, 3, 15),
            end_date=datetime.date(cls.current_academic_yr.year + 1, 6, 28),
            academic_year=cls.current_academic_yr,
            reference=academic_calendar_type.SCORES_EXAM_SUBMISSION)
        cls.academic_calendar_3 = AcademicCalendarFactory(
            title="Submission of score encoding - 3",
            start_date=datetime.date(cls.current_academic_yr.year + 1, 8, 1),
            end_date=datetime.date(cls.current_academic_yr.year + 1, 9, 29),
            academic_year=cls.current_academic_yr,
            reference=academic_calendar_type.SCORES_EXAM_SUBMISSION)
        cls.academic_calendar_4 = AcademicCalendarFactory(
            title="Deliberation session 1",
            start_date=datetime.date(cls.current_academic_yr.year + 1, 1, 1),
            end_date=datetime.date(cls.current_academic_yr.year + 1, 1, 2),
            academic_year=cls.current_academic_yr,
            reference=academic_calendar_type.DELIBERATION)
コード例 #9
0
    def setUpTestData(cls):
        ProgramManagerGroupFactory()

        cls.user = SuperUserFactory()
        cls.person = PersonFactory()

        cls.structure_parent1 = StructureFactory(acronym='SSH')

        cls.structure_child1 = StructureFactory(acronym='TECO', part_of=cls.structure_parent1)
        cls.structure_child11 = StructureFactory(acronym='TEBI', part_of=cls.structure_child1)

        cls.structure_child2 = StructureFactory(acronym='ESPO', part_of=cls.structure_parent1)
        cls.structure_child21 = StructureFactory(acronym='ECON', part_of=cls.structure_child2)
        cls.structure_child22 = StructureFactory(acronym='COMU', part_of=cls.structure_child2)
        EntityManagerFactory(person__user=cls.user, structure=cls.structure_parent1)

        cls.academic_year_previous, cls.academic_year_current = AcademicYearFactory.produce_in_past(quantity=2)
コード例 #10
0
    def setUpTestData(cls):
        ProgramManagerGroupFactory()

        cls.user = SuperUserFactory()
        cls.person = PersonFactory()

        cls.structure_parent1 = StructureFactory(acronym='SSH')

        cls.structure_child1 = StructureFactory(acronym='TECO', part_of=cls.structure_parent1)
        cls.structure_child11 = StructureFactory(acronym='TEBI', part_of=cls.structure_child1)

        cls.structure_child2 = StructureFactory(acronym='ESPO', part_of=cls.structure_parent1)
        cls.structure_child21 = StructureFactory(acronym='ECON', part_of=cls.structure_child2)
        cls.structure_child22 = StructureFactory(acronym='COMU', part_of=cls.structure_child2)
        EntityManagerFactory(person__user=cls.user, structure=cls.structure_parent1)

        cls.academic_year_previous, cls.academic_year_current = AcademicYearFactory.produce_in_past(quantity=2)
コード例 #11
0
    def setUpTestData(cls):
        cls.language = LanguageFactory(code="EN")
        cls.person = PersonFactory()
        cls.person.user.user_permissions.add(
            Permission.objects.get(codename="can_edit_learningunit_pedagogy"))
        cls.current_ac = AcademicYearFactory(current=True)
        cls.past_ac_years = AcademicYearFactory.produce_in_past(
            cls.current_ac.year - 1, 5)
        cls.future_ac_years = AcademicYearFactory.produce_in_future(
            cls.current_ac.year + 1, 5)

        cls.current_luy = LearningUnitYearFactory(
            learning_container_year__academic_year=cls.current_ac,
            academic_year=cls.current_ac,
            acronym="LAGRO1000",
            subtype=FULL)
        cls.luys = {cls.current_ac.year: cls.current_luy}
        cls.luys.update(
            _duplicate_learningunityears(cls.current_luy,
                                         academic_years=cls.past_ac_years +
                                         cls.future_ac_years))
コード例 #12
0
    def setUpTestData(cls):
        ProgramManagerGroupFactory()

        cls.user = User.objects.create_user('tmp', '*****@*****.**', 'tmp')
        cls.person = PersonFactory()

        cls.structure_parent1 = StructureFactory(acronym='SSH')

        cls.structure_child1 = StructureFactory(acronym='TECO',
                                                part_of=cls.structure_parent1)
        cls.structure_child11 = StructureFactory(acronym='TEBI',
                                                 part_of=cls.structure_child1)

        cls.structure_child2 = StructureFactory(acronym='ESPO',
                                                part_of=cls.structure_parent1)
        cls.structure_child21 = StructureFactory(acronym='ECON',
                                                 part_of=cls.structure_child2)
        cls.structure_child22 = StructureFactory(acronym='COMU',
                                                 part_of=cls.structure_child2)

        cls.academic_year_previous, cls.academic_year_current = AcademicYearFactory.produce_in_past(
            quantity=2)
コード例 #13
0
ファイル: test_perms.py プロジェクト: aelwhishi/osis
 def setUpTestData(cls):
     cls.current_acy, cls.previous_acy = AcademicYearFactory.produce_in_past(
         quantity=2)
     cls.group_element_year = GroupElementYearFactory(
         parent=TrainingFactory(academic_year=cls.current_acy),
         child_branch=MiniTrainingFactory(academic_year=cls.current_acy))