class TestSettingsFactory(TestCase): def setUp(self): self.settings = SettingsFactory() def test_access_to_procedure_is_open(self): self.assertEqual(access_to_procedure_is_open(), True) def test_access_to_procedure_is_not_open(self): self.settings.starting_date = timezone.now() + timezone.timedelta(days=10) self.settings.ending_date = timezone.now() + timezone.timedelta(days=50) self.settings.save() self.assertFalse(access_to_procedure_is_open())
class TestSettingsFactory(TestCase): def setUp(self): self.settings = SettingsFactory() def test_access_to_procedure_is_open(self): self.assertEqual(access_to_procedure_is_open(), True) def test_access_to_procedure_is_not_open(self): self.settings.starting_date = timezone.now() + timezone.timedelta( days=10) self.settings.ending_date = timezone.now() + timezone.timedelta( days=50) self.settings.save() self.assertFalse(access_to_procedure_is_open())
def setUpTestData(cls): cls.settings = SettingsFactory() cls.manager = ManagerFactory() cls.current_academic_year = AcademicYearFactory(current=True) cls.supervisor = PersonFactory() cls.assistant = AcademicAssistantFactory( phd_inscription_date=datetime.date( cls.current_academic_year.year - 3, 10, 2), thesis_title='Data fitting on manifolds', confirmation_test_date=datetime.date( cls.current_academic_year.year - 1, 9, 14), remark= "Deux co-promoteurs (l'application ne m'autorise à n'en renseigner qu'un)", supervisor=cls.supervisor) cls.styles = getSampleStyleSheet() cls.styles.add( ParagraphStyle( name='Tiny', fontSize=6, font='Helvetica', leading=8, leftIndent=0, rightIndent=0, firstLineIndent=0, alignment=TA_LEFT, spaceBefore=0, spaceAfter=0, splitLongWords=1, )) cls.reviewer3 = ReviewerFactory()
def setUpTestData(cls): cls.settings = SettingsFactory() cls.current_academic_year = AcademicYearFactory(current=True) cls.assistant_mandate = AssistantMandateFactory( academic_year=cls.current_academic_year, state=assistant_mandate_state.PHD_SUPERVISOR) cls.review = ReviewFactory(reviewer=None, mandate=cls.assistant_mandate, status=review_status.IN_PROGRESS) cls.institute = EntityVersionFactory(entity_type=entity_type.INSTITUTE, end_date=None) cls.institute_child = EntityVersionFactory(parent=cls.institute.entity, end_date=None) cls.school = EntityVersionFactory(entity_type=entity_type.SCHOOL, end_date=None) cls.sector = EntityVersionFactory(entity_type=entity_type.SECTOR) cls.faculty = EntityVersionFactory(entity_type=entity_type.FACULTY) cls.mandate_entity = MandateEntityFactory( assistant_mandate=cls.assistant_mandate, entity=cls.institute.entity) cls.research_reviewer = ReviewerFactory(role=reviewer_role.RESEARCH, entity=cls.institute.entity) cls.research_assistant_reviewer = ReviewerFactory( role=reviewer_role.RESEARCH_ASSISTANT, entity=cls.institute_child.entity) cls.vice_sector_reviewer = ReviewerFactory( role=reviewer_role.VICE_RECTOR, entity=cls.school.entity) cls.supervision_reviewer = ReviewerFactory( role=reviewer_role.SUPERVISION, entity=cls.faculty.entity) cls.delegate = PersonFactory() cls.delegate2 = PersonFactory()
def setUpTestData(cls): cls.settings = SettingsFactory() cls.previous_academic_year, cls.current_academic_year, _ = AcademicYearFactory.produce( ) cls.phd_supervisor = PersonFactory() cls.assistant = AcademicAssistantFactory(supervisor=cls.phd_supervisor) cls.assistant_mandate = AssistantMandateFactory( academic_year=cls.current_academic_year, assistant=cls.assistant, state=assistant_mandate_state.PHD_SUPERVISOR) cls.assistant2 = AcademicAssistantFactory(supervisor=None) cls.assistant_mandate2 = AssistantMandateFactory( academic_year=cls.current_academic_year, assistant=cls.assistant2, state=assistant_mandate_state.RESEARCH, ) cls.review = ReviewFactory(reviewer=None, mandate=cls.assistant_mandate, status=review_status.IN_PROGRESS) cls.entity_version = EntityVersionFactory( entity_type=entity_type.INSTITUTE, end_date=None) cls.mandate_entity = MandateEntityFactory( assistant_mandate=cls.assistant_mandate, entity=cls.entity_version.entity) cls.mandate_entity2 = MandateEntityFactory( assistant_mandate=cls.assistant_mandate2, entity=cls.entity_version.entity) cls.reviewer = ReviewerFactory(role=reviewer_role.RESEARCH, entity=cls.entity_version.entity, person=cls.phd_supervisor)
def setUpTestData(cls): cls.settings = SettingsFactory() today = datetime.date.today() cls.current_academic_year = AcademicYearFactory(start_date=today, end_date=today.replace(year=today.year + 1), year=today.year) cls.current_academic_year.save() cls.phd_supervisor = PersonFactory() cls.assistant = AcademicAssistantFactory(supervisor=cls.phd_supervisor) cls.assistant_mandate2 = AssistantMandateFactory( academic_year=cls.current_academic_year, assistant=cls.assistant, state=assistant_mandate_state.RESEARCH ) cls.entity_version = EntityVersionFactory(entity_type=entity_type.INSTITUTE) cls.entity_version2 = EntityVersionFactory(entity_type=entity_type.FACULTY) cls.entity_version3 = EntityVersionFactory(entity_type=entity_type.SECTOR) cls.reviewer = ReviewerFactory( role=reviewer_role.RESEARCH, entity=cls.entity_version.entity ) cls.reviewer2 = ReviewerFactory( role=reviewer_role.SUPERVISION, entity=cls.entity_version2.entity ) cls.reviewer3 = ReviewerFactory( role=reviewer_role.VICE_RECTOR, entity=cls.entity_version3.entity ) MandateEntityFactory( assistant_mandate=cls.assistant_mandate2, entity=cls.entity_version.entity )
def setUp(self): self.factory = RequestFactory() self.client = Client() self.settings = SettingsFactory() today = datetime.date.today() self.current_academic_year = AcademicYearFactory( start_date=today, end_date=today.replace(year=today.year + 1), year=today.year) self.phd_supervisor = PersonFactory() self.assistant = AcademicAssistantFactory( supervisor=self.phd_supervisor) self.assistant_mandate = AssistantMandateFactory( academic_year=self.current_academic_year, assistant=self.assistant) self.assistant_mandate.state = assistant_mandate_state.PHD_SUPERVISOR self.assistant_mandate.save() self.review = ReviewFactory(reviewer=None, mandate=self.assistant_mandate, status=review_status.IN_PROGRESS) self.entity_version = EntityVersionFactory( entity_type=entity_type.INSTITUTE) self.mandate_entity = MandateEntityFactory( assistant_mandate=self.assistant_mandate, entity=self.entity_version.entity)
def setUp(self): self.factory = RequestFactory() self.user = User.objects.create_user( username='******', email='*****@*****.**', password='******') self.user.save() self.person = Person.objects.create(user=self.user, first_name='first_name', last_name='last_name') self.person.save() self.academic_assistant = AcademicAssistant.objects.create( person=self.person) self.academic_assistant.save() self.user = User.objects.create_user( username='******', email='*****@*****.**', password='******') self.person = Person.objects.create(user=self.user, first_name='Lodia', last_name='Perzyna') self.person.save() self.manager = Manager.objects.create(person=self.person) self.manager.save() self.client.login(username=self.manager.person.user.username, password=self.manager.person.user.password) self.current_academic_year = AcademicYearFactory() self.assistant_mandate = AssistantMandate.objects.create( assistant=self.academic_assistant, academic_year=self.current_academic_year, entry_date=date(2015, 9, 1), end_date=date(2017, 9, 1), fulltime_equivalent=1, renewal_type='normal') self.user = User.objects.create_user( username='******', email='*****@*****.**', password='******') self.user.save() self.phd_supervisor = Person.objects.create(user=self.user, first_name='phd', last_name='supervisor') self.phd_supervisor.save() self.academic_assistant.supervisor = self.phd_supervisor self.academic_assistant.save() self.settings = SettingsFactory() self.user = User.objects.create_user( username='******', email='*****@*****.**', password='******') self.user.save() self.person = Person.objects.create(user=self.user, first_name='first_name', last_name='last_name') self.person.save() self.reviewer = Reviewer.objects.create(person=self.person, role='SUPERVISION') self.reviewer.save()
def setUpTestData(cls): cls.settings = SettingsFactory() cls.current_academic_year = AcademicYearFactory(current=True) cls.tutor = TutorFactory() cls.get_url = reverse("form_part3_edit") cls.post_url = reverse("form_part3_save")
def setUpTestData(cls): cls.open_settings = SettingsFactory() cls.previous_acy, cls.current_acy, cls.next_acy = AcademicYearFactory.produce( ) cls.academic_assistant = AcademicAssistantFactory() cls.assistant_mandate = AssistantMandateFactory( assistant=cls.academic_assistant, academic_year=cls.current_acy) cls.url = urls.reverse('assistant_mandates')
def setUp(self): self.factory = RequestFactory() self.client = Client() self.settings = SettingsFactory() today = datetime.date.today() self.current_academic_year = AcademicYearFactory( start_date=today, end_date=today.replace(year=today.year + 1), year=today.year) self.current_academic_year.save() self.phd_supervisor = PersonFactory() self.assistant = AcademicAssistantFactory( supervisor=self.phd_supervisor) self.assistant_mandate = AssistantMandateFactory( academic_year=self.current_academic_year, assistant=self.assistant, state=assistant_mandate_state.RESEARCH) self.assistant_mandate2 = AssistantMandateFactory( academic_year=self.current_academic_year, assistant=self.assistant, state=assistant_mandate_state.RESEARCH) self.phd_supervisor_review = ReviewFactory( reviewer=None, mandate=self.assistant_mandate, status=review_status.DONE) self.entity_version = EntityVersionFactory( entity_type=entity_type.INSTITUTE) self.entity_mandate = MandateEntityFactory( assistant_mandate=self.assistant_mandate, entity=self.entity_version.entity) self.entity_mandate2 = MandateEntityFactory( assistant_mandate=self.assistant_mandate2, entity=self.entity_version.entity) self.reviewer = ReviewerFactory(role=reviewer_role.RESEARCH, entity=self.entity_version.entity) self.review = ReviewFactory(reviewer=self.reviewer, mandate=self.assistant_mandate, status=review_status.IN_PROGRESS) self.entity_version2 = EntityVersionFactory( entity_type=entity_type.FACULTY) self.entity_mandate2 = MandateEntityFactory( assistant_mandate=self.assistant_mandate, entity=self.entity_version2.entity) self.reviewer2 = ReviewerFactory(role=reviewer_role.SUPERVISION, entity=self.entity_version2.entity) self.entity_version3 = EntityVersionFactory( entity_type=entity_type.SECTOR) self.entity_mandate3 = MandateEntityFactory( assistant_mandate=self.assistant_mandate, entity=self.entity_version3.entity) self.reviewer3 = ReviewerFactory(role=reviewer_role.VICE_RECTOR, entity=self.entity_version3.entity)
def setUpTestData(cls): today = datetime.date.today() cls.current_academic_year = AcademicYearFactory(start_date=today, end_date=today.replace(year=today.year + 1), year=today.year) cls.settings = SettingsFactory() cls.manager = ManagerFactory() cls.entity_version = EntityVersionFactory(entity_type=entity_type.INSTITUTE) cls.reviewer = ReviewerFactory(entity=cls.entity_version.entity) cls.assistant = AcademicAssistantFactory() cls.unauthorized_person = PersonFactory()
def setUp(self): self.factory = RequestFactory() self.client = Client() self.settings = SettingsFactory() today = datetime.date.today() self.manager = ManagerFactory() self.assistant = AcademicAssistantFactory() self.current_academic_year = AcademicYearFactory(start_date=today, end_date=today.replace(year=today.year + 1), year=today.year) self.assistant_mandate = AssistantMandateFactory(academic_year=self.current_academic_year, state=assistant_mandate_state.RESEARCH)
def setUpTestData(cls): cls.settings = SettingsFactory() today = datetime.date.today() cls.manager = ManagerFactory() cls.assistant = AcademicAssistantFactory() cls.current_academic_year = AcademicYearFactory( start_date=today, end_date=today.replace(year=today.year + 1), year=today.year) cls.assistant_mandate = AssistantMandateFactory( academic_year=cls.current_academic_year, state=assistant_mandate_state.RESEARCH)
def setUp(self): self.factory = RequestFactory() self.settings = SettingsFactory() today = datetime.date.today() self.current_academic_year = AcademicYearFactory(start_date=today, end_date=today.replace(year=today.year + 1), year=today.year) self.assistant_mandate = AssistantMandateFactory(academic_year=self.current_academic_year) self.assistant_mandate.state = assistant_mandate_state.TRTS self.assistant_mandate.save() LearningUnitYearFactory(academic_year=self.current_academic_year, acronym="LBIR1210") LearningUnitYearFactory(academic_year=self.current_academic_year, acronym="LBIR1211")
def setUpTestData(cls): cls.settings = SettingsFactory() cls.current_academic_year = AcademicYearFactory(current=True) cls.assistant_mandate = AssistantMandateFactory( academic_year=cls.current_academic_year, state=assistant_mandate_state.TRTS) LearningUnitYearFactory(academic_year=cls.current_academic_year, acronym="LBIR1210") LearningUnitYearFactory(academic_year=cls.current_academic_year, acronym="LBIR1211")
def setUp(self): self.factory = RequestFactory() self.client = Client() today = datetime.date.today() self.current_academic_year = AcademicYearFactory(start_date=today, end_date=today.replace(year=today.year + 1), year=today.year) self.settings = SettingsFactory() self.manager = ManagerFactory() self.entity_version = EntityVersionFactory(entity_type=entity_type.INSTITUTE) self.reviewer = ReviewerFactory(entity=self.entity_version.entity) self.assistant = AcademicAssistantFactory() self.unauthorized_person = PersonFactory()
def setUp(self): self.factory = RequestFactory() self.client = Client() self.manager = ManagerFactory() self.settings = SettingsFactory() self.client.force_login(self.manager.person.user) self.assistant = AcademicAssistantFactory() self.assistant_mandate = AssistantMandateFactory( state=assistant_mandate_state.TRTS, assistant=self.assistant, assistant_type=assistant_type.ASSISTANT) self.assistant2 = AcademicAssistantFactory() self.assistant_mandate2 = AssistantMandateFactory( state=assistant_mandate_state.SUPERVISION, assistant=self.assistant2, assistant_type=assistant_type.TEACHING_ASSISTANT) self.entity1 = EntityFactory() self.entity_version1 = EntityVersionFactory( entity=self.entity1, entity_type=entity_type.SECTOR) self.entity2 = EntityFactory() self.entity_version2 = EntityVersionFactory( entity=self.entity2, entity_type=entity_type.FACULTY) self.entity3 = EntityFactory() self.entity_version3 = EntityVersionFactory( entity=self.entity3, entity_type=entity_type.INSTITUTE) self.entity4 = EntityFactory() self.entity_version4 = EntityVersionFactory( entity=self.entity4, parent=self.entity2, entity_type=entity_type.SCHOOL) self.mandate_entity1 = MandateEntityFactory( assistant_mandate=self.assistant_mandate, entity=self.entity1) self.mandate_entity2 = MandateEntityFactory( assistant_mandate=self.assistant_mandate, entity=self.entity2) self.mandate_entity3 = MandateEntityFactory( assistant_mandate=self.assistant_mandate, entity=self.entity3) self.mandate_entity4 = MandateEntityFactory( assistant_mandate=self.assistant_mandate2, entity=self.entity1) self.mandate_entity5 = MandateEntityFactory( assistant_mandate=self.assistant_mandate2, entity=self.entity2) self.reviewer1 = ReviewerFactory(entity=self.entity3, role=reviewer_role.RESEARCH) self.reviewer2 = ReviewerFactory(entity=self.entity2, role=reviewer_role.SUPERVISION) self.reviewer3 = ReviewerFactory(entity=self.entity1, role=reviewer_role.VICE_RECTOR) self.reviewer4 = ReviewerFactory(entity=None, role=reviewer_role.PHD_SUPERVISOR)
def setUpTestData(cls): cls.academic_assistant = AcademicAssistantFactory() cls.manager = ManagerFactory() cls.current_academic_year = AcademicYearFactory() cls.assistant_mandate = AssistantMandateFactory(assistant=cls.academic_assistant) cls.user = User.objects.create_user( username='******', email='*****@*****.**', password='******' ) cls.user.save() cls.phd_supervisor = Person.objects.create(user=cls.user, first_name='phd', last_name='supervisor') cls.phd_supervisor.save() cls.academic_assistant.supervisor = cls.phd_supervisor cls.academic_assistant.save() cls.settings = SettingsFactory() cls.reviewer = ReviewerFactory(role=reviewer_role.SUPERVISION)
def setUpTestData(cls): cls.manager = ManagerFactory() cls.settings = SettingsFactory() cls.assistant = AcademicAssistantFactory() cls.assistant_mandate = AssistantMandateFactory( state=assistant_mandate_state.TRTS, assistant=cls.assistant, assistant_type=assistant_type.ASSISTANT) cls.assistant2 = AcademicAssistantFactory() cls.assistant_mandate2 = AssistantMandateFactory( state=assistant_mandate_state.SUPERVISION, assistant=cls.assistant2, assistant_type=assistant_type.TEACHING_ASSISTANT) cls.entity1 = EntityFactory() cls.entity_version1 = EntityVersionFactory( entity=cls.entity1, entity_type=entity_type.SECTOR) cls.entity2 = EntityFactory() cls.entity_version2 = EntityVersionFactory( entity=cls.entity2, entity_type=entity_type.FACULTY) cls.entity3 = EntityFactory() cls.entity_version3 = EntityVersionFactory( entity=cls.entity3, entity_type=entity_type.INSTITUTE) cls.entity4 = EntityFactory() cls.entity_version4 = EntityVersionFactory( entity=cls.entity4, parent=cls.entity2, entity_type=entity_type.SCHOOL) cls.mandate_entity1 = MandateEntityFactory( assistant_mandate=cls.assistant_mandate, entity=cls.entity1) cls.mandate_entity2 = MandateEntityFactory( assistant_mandate=cls.assistant_mandate, entity=cls.entity2) cls.mandate_entity3 = MandateEntityFactory( assistant_mandate=cls.assistant_mandate, entity=cls.entity3) cls.mandate_entity4 = MandateEntityFactory( assistant_mandate=cls.assistant_mandate2, entity=cls.entity1) cls.mandate_entity5 = MandateEntityFactory( assistant_mandate=cls.assistant_mandate2, entity=cls.entity2) cls.reviewer1 = ReviewerFactory(entity=cls.entity3, role=reviewer_role.RESEARCH) cls.reviewer2 = ReviewerFactory(entity=cls.entity2, role=reviewer_role.SUPERVISION) cls.reviewer3 = ReviewerFactory(entity=cls.entity1, role=reviewer_role.VICE_RECTOR) cls.reviewer4 = ReviewerFactory(entity=None, role=reviewer_role.PHD_SUPERVISOR)
def setUpTestData(cls): cls.settings = SettingsFactory() today = datetime.date.today() cls.current_academic_year = AcademicYearFactory(start_date=today, end_date=today.replace(year=today.year + 1), year=today.year) cls.phd_supervisor = PersonFactory() cls.assistant = AcademicAssistantFactory(supervisor=cls.phd_supervisor) cls.assistant_mandate = AssistantMandateFactory(academic_year=cls.current_academic_year, assistant=cls.assistant) cls.assistant_mandate.state = assistant_mandate_state.PHD_SUPERVISOR cls.assistant_mandate.save() cls.review = ReviewFactory(reviewer=None, mandate=cls.assistant_mandate, status=review_status.IN_PROGRESS) cls.entity = EntityFactory() cls.entity_version = EntityVersionFactory(entity=cls.entity, entity_type=entity_type.INSTITUTE) cls.mandate_entity = MandateEntityFactory(assistant_mandate=cls.assistant_mandate, entity=cls.entity) cls.reviewer = ReviewerFactory(role=reviewer_role.RESEARCH, entity=cls.entity_version.entity)
def setUp(self): self.settings = SettingsFactory()
def setUp(self): self.client = Client() self.settings = SettingsFactory() self.manager = ManagerFactory() self.factory = RequestFactory() self.supervisor = PersonFactory() self.assistant = AcademicAssistantFactory( phd_inscription_date=datetime.date(2015, 10, 2), thesis_title='Data fitting on manifolds', confirmation_test_date=datetime.date(2017, 9, 25), remark= "Deux co-promoteurs (l'application ne m'autorise à n'en renseigner qu'un)", supervisor=self.supervisor) self.mandate = AssistantMandateFactory( assistant=self.assistant, assistant_type=assistant_type.ASSISTANT, sap_id='1120019', entry_date=datetime.date(2012, 9, 15), end_date=datetime.date(2018, 9, 14), contract_duration='6 ans', contract_duration_fte='6 ans', fulltime_equivalent=1, other_status=None, renewal_type=assistant_mandate_renewal.NORMAL, justification=None, external_contract='', external_functions='', ) self.tutoring_learning_unit_year = TutoringLearningUnitYearFactory( mandate=self.mandate) self.review3 = ReviewFactory(mandate=self.mandate, reviewer=None) self.entity_version = EntityVersionFactory() self.mandate_entity = MandateEntityFactory( assistant_mandate=self.mandate, entity=self.entity_version.entity) self.entity_version2 = EntityVersionFactory( entity_type=entity_type.FACULTY, end_date=None) self.mandate_entity2 = MandateEntityFactory( assistant_mandate=self.mandate, entity=self.entity_version2.entity) self.reviewer = ReviewerFactory(role=reviewer_role.SUPERVISION, entity=self.mandate_entity.entity) self.reviewer2 = ReviewerFactory(entity=self.mandate_entity2.entity) self.styles = getSampleStyleSheet() self.styles.add( ParagraphStyle( name='Tiny', fontSize=6, font='Helvetica', leading=8, leftIndent=0, rightIndent=0, firstLineIndent=0, alignment=TA_LEFT, spaceBefore=0, spaceAfter=0, splitLongWords=1, )) self.review1 = ReviewFactory(mandate=self.mandate, reviewer=self.reviewer) self.review2 = ReviewFactory(mandate=self.mandate, reviewer=self.reviewer2, status=review_status.IN_PROGRESS) self.review3 = ReviewFactory(mandate=self.mandate, reviewer=None) self.reviewer3 = ReviewerFactory()
def setUpTestData(cls): cls.settings = SettingsFactory()