def test_get_phd_data(self): thesis_title = export_utils_pdf.format_data( self.assistant.thesis_title, _('Title (provisional) of the thesis')) phd_inscription_date = export_utils_pdf.format_data( self.assistant.phd_inscription_date, _('Date of doctoral enrollment')) confirmation_test_date = export_utils_pdf.format_data( self.assistant.confirmation_test_date, _('Programmed date of confirmation test')) succed_confirmation_test_date = export_utils_pdf.format_data( self.assistant.succeed_confirmation_test_date, _('Date of succeeded confirmation test')) thesis_date = export_utils_pdf.format_data( self.assistant.thesis_date, _('Date of defense of thesis (if already known)')) expected_phd_date = export_utils_pdf.format_data( self.assistant.expected_phd_date, _('Scheduled date of registration')) inscription = export_utils_pdf.format_data( dict(assistant_phd_inscription.PHD_INSCRIPTION_CHOICES).get( self.assistant.inscription, ''), _('Enrolled in the Ph.D. program')) remark = export_utils_pdf.format_data(self.assistant.remark, _('Remark')) self.assertEqual( inscription + phd_inscription_date + expected_phd_date + confirmation_test_date + succed_confirmation_test_date + thesis_title + thesis_date + remark, export_utils_pdf.get_phd_data(self.assistant))
def test_get_administrative_data(self): format_data_parameters_list = [ (self.mandate.get_state_display(), _("Renewal state"), True), (dict(assistant_type.ASSISTANT_TYPES).get( self.mandate.assistant_type), _('Assistant type')), (self.mandate.sap_id, _('Registration number')), (self.mandate.entry_date, _('Contract start date')), (self.mandate.end_date, _('Contract end date')), (self.mandate.contract_duration, _('Contract length')), (self.mandate.contract_duration_fte, _('Full-time equivalent')), (int(self.mandate.fulltime_equivalent * 100), _('Percentage of occupancy')), (self.mandate.other_status, _('Other status')), (dict( assistant_mandate_renewal.ASSISTANT_MANDATE_RENEWAL_TYPES).get( self.mandate.renewal_type), _('Renewal type')), (self.mandate.justification, _("Should you no longer fulfill the requirements for a 'normal' renewal, can you specify the " "circumstances justifying an exceptional renewal application (art. 51 of the RAMCS)" )), (self.mandate.external_contract, _('Mandate requested externally (FNRS, FRIA, ...)')), (self.mandate.external_functions, _('Current positions outside the University and %% of time spent') ) ] formated_datas = (export_utils_pdf.format_data(*parameters) for parameters in format_data_parameters_list) mandate_content_expected = functools.reduce(operator.add, formated_datas, "") self.assertEqual( mandate_content_expected, export_utils_pdf.get_administrative_data(self.mandate))
def test_get_formation_activities(self): formations = export_utils_pdf.format_data( self.mandate.formations, _('Scientific, pedagogical or other training you have attended (LLL, SMCS, RHUM, Summer School)' )) self.assertEqual( formations, export_utils_pdf.get_formation_activities(self.mandate))
def test_get_representation_activities(self): faculty_representation = export_utils_pdf.format_data( str(self.mandate.faculty_representation), 'faculty_representation') institute_representation = export_utils_pdf.format_data( str(self.mandate.institute_representation), 'institute_representation') sector_representation = export_utils_pdf.format_data( str(self.mandate.sector_representation), 'sector_representation') governing_body_representation = export_utils_pdf.format_data( str(self.mandate.governing_body_representation), 'governing_body_representation') corsci_representation = export_utils_pdf.format_data( str(self.mandate.corsci_representation), 'corsci_representation') self.assertEqual( faculty_representation + institute_representation + sector_representation + governing_body_representation + corsci_representation, export_utils_pdf.get_representation_activities(self.mandate))
def test_get_service_activities(self): students_service = export_utils_pdf.format_data( str(self.mandate.students_service), 'students_service') infrastructure_mgmt_service = export_utils_pdf.format_data( str(self.mandate.infrastructure_mgmt_service), 'infrastructure_mgmt_service') events_organisation_service = export_utils_pdf.format_data( str(self.mandate.events_organisation_service), 'events_organisation_service') publishing_field_service = export_utils_pdf.format_data( str(self.mandate.publishing_field_service), 'publishing_field_service') scientific_jury_service = export_utils_pdf.format_data( str(self.mandate.scientific_jury_service), 'scientific_jury_service') self.assertEqual( students_service + infrastructure_mgmt_service + events_organisation_service + publishing_field_service + scientific_jury_service, export_utils_pdf.get_service_activities(self.mandate))
def test_get_representation_activities(self): faculty_representation = export_utils_pdf.format_data( str(self.mandate.faculty_representation), _('Within the faculty (program committees, faculty board, faculty council)' )) institute_representation = export_utils_pdf.format_data( str(self.mandate.institute_representation), _('Within the institute (institute board, institute council,...)')) sector_representation = export_utils_pdf.format_data( str(self.mandate.sector_representation), _('Within the sector (board and/or council)')) governing_body_representation = export_utils_pdf.format_data( str(self.mandate.governing_body_representation), _('Within the organs of the University (academic council, other councils or commissions,...)' )) corsci_representation = export_utils_pdf.format_data( str(self.mandate.corsci_representation), _('Within the CORSCI')) self.assertEqual( faculty_representation + institute_representation + sector_representation + governing_body_representation + corsci_representation, export_utils_pdf.get_representation_activities(self.mandate))
def test_get_service_activities(self): students_service = export_utils_pdf.format_data( str(self.mandate.students_service), _('Information for future students (CIO, shows, Campus Days, Midi Masters,...)' )) infrastructure_mgmt_service = export_utils_pdf.format_data( str(self.mandate.infrastructure_mgmt_service), _('Management of collective facilities (lab, workshop, library, IT department, website,...)' )) events_organisation_service = export_utils_pdf.format_data( str(self.mandate.events_organisation_service), _("Organization of seminars, conferences, visits, study tours, grounds, seminars… (not taken in account in " "the 'Teaching units' section)")) publishing_field_service = export_utils_pdf.format_data( str(self.mandate.publishing_field_service), _('Activities in the field of publishing (editorial board,...)')) scientific_jury_service = export_utils_pdf.format_data( str(self.mandate.scientific_jury_service), _('Participation in juries and/or scientific committees')) self.assertEqual( students_service + infrastructure_mgmt_service + events_organisation_service + publishing_field_service + scientific_jury_service, export_utils_pdf.get_service_activities(self.mandate))
def test_get_phd_data(self): thesis_title = export_utils_pdf.format_data( self.assistant.thesis_title, 'thesis_title') phd_inscription_date = export_utils_pdf.format_data( self.assistant.phd_inscription_date, 'phd_inscription_date') confirmation_test_date = export_utils_pdf.format_data( self.assistant.confirmation_test_date, 'confirmatory_test_date') thesis_date = export_utils_pdf.format_data(self.assistant.thesis_date, 'thesis_defence_date') expected_phd_date = export_utils_pdf.format_data( self.assistant.expected_phd_date, 'expected_registering_date') inscription = export_utils_pdf.format_data( _(self.assistant.inscription) if self.assistant.inscription else None, 'registered_phd') remark = export_utils_pdf.format_data(self.assistant.remark, 'remark') self.assertEqual(inscription + phd_inscription_date + expected_phd_date + confirmation_test_date + thesis_title \ + thesis_date + remark, export_utils_pdf.get_phd_data(self.assistant))
def test_get_research_data(self): internships = export_utils_pdf.format_data(self.mandate.internships, 'scientific_internships') conferences = export_utils_pdf.format_data(self.mandate.conferences, 'conferences_contributor') publications = export_utils_pdf.format_data( self.mandate.publications, 'publications_in_progress') awards = export_utils_pdf.format_data(self.mandate.awards, 'awards') framing = export_utils_pdf.format_data(self.mandate.framing, 'framing_participation') remark = export_utils_pdf.format_data(self.mandate.remark, 'remark') self.assertEqual( internships + conferences + publications + awards + framing + remark, export_utils_pdf.get_research_data(self.mandate))
def test_get_research_data(self): internships = export_utils_pdf.format_data( self.mandate.internships, _('Scientific stay(s) and/or course(s)')) conferences = export_utils_pdf.format_data( self.mandate.conferences, _('Conference(s) to which I have contributed by communication or post, alone or with others.' )) publications = export_utils_pdf.format_data( self.mandate.publications, _('Publication(s) in preparation')) awards = export_utils_pdf.format_data( self.mandate.awards, _('Prize(s) and/or distinction(s)')) framing = export_utils_pdf.format_data( self.mandate.framing, _('Participation in thesis and/or dissertation')) remark = export_utils_pdf.format_data(self.mandate.remark, _('Remark')) self.assertEqual( internships + conferences + publications + awards + framing + remark, export_utils_pdf.get_research_data(self.mandate))
def test_get_formation_activities(self): formations = export_utils_pdf.format_data(self.mandate.formations, 'formations') self.assertEqual( formations, export_utils_pdf.get_formation_activities(self.mandate))
def test_get_summary(self): report_remark = export_utils_pdf.format_data( self.mandate.activities_report_remark, 'activities_report_remark') self.assertEqual(report_remark, export_utils_pdf.get_summary(self.mandate))
def test_get_administrative_data(self): assistant_type = export_utils_pdf.format_data( _(self.mandate.assistant_type), 'assistant_type') matricule = export_utils_pdf.format_data(self.mandate.sap_id, 'matricule_number') entry_date = export_utils_pdf.format_data(self.mandate.entry_date, 'entry_date_contract') end_date = export_utils_pdf.format_data(self.mandate.end_date, 'end_date_contract') contract_duration = export_utils_pdf.format_data( self.mandate.contract_duration, 'contract_duration') contract_duration_fte = export_utils_pdf.format_data( self.mandate.contract_duration_fte, 'contract_duration_fte') fulltime_equivalent = export_utils_pdf.format_data( int(self.mandate.fulltime_equivalent * 100), 'fulltime_equivalent_percentage') other_status = export_utils_pdf.format_data(self.mandate.other_status, 'other_status') renewal_type = export_utils_pdf.format_data( _(self.mandate.renewal_type), 'renewal_type') justification = export_utils_pdf.format_data( self.mandate.justification, 'exceptional_justification') external_contract = export_utils_pdf.format_data( self.mandate.external_contract, 'external_post') external_functions = export_utils_pdf.format_data( self.mandate.external_functions, 'function_outside_university') self.assertEqual( assistant_type + matricule + entry_date + end_date + contract_duration + contract_duration_fte + fulltime_equivalent + other_status + renewal_type + justification + external_contract + external_functions, export_utils_pdf.get_administrative_data(self.mandate))
def test_format_data(self): data = 'good example of data.' title = 'formations' self.assertEqual("<strong>%s :</strong> %s<br />" % (_(title), data), export_utils_pdf.format_data(data, title))
def test_get_summary(self): report_remark = export_utils_pdf.format_data( self.mandate.activities_report_remark, _('Remark concerning the activity report')) self.assertEqual(report_remark, export_utils_pdf.get_summary(self.mandate))