Ejemplo n.º 1
0
 def test_career_center_events(self):
     event_data = [
         {
             EventFields.ID: "38305945",
             EventFields.NAME: "Homewood: Consulting Alumni Panel",
             EventFields.CAREER_CENTER: CareerCenters.HOMEWOOD,
             EventFields.IS_INVITE_ONLY: 'No',
             EventFields.START_DATE_TIME: IN_THE_FUTURE
         },
         {
             EventFields.ID: "150925098",
             EventFields.NAME: "Carey: Resume Workshop",
             EventFields.CAREER_CENTER: CareerCenters.CAREY,
             EventFields.IS_INVITE_ONLY: 'No',
             EventFields.START_DATE_TIME: IN_THE_FUTURE
         },
         {
             EventFields.ID: "95739393",
             EventFields.NAME: "PDCO: Resume Workshop",
             EventFields.CAREER_CENTER: CareerCenters.PDCO,
             EventFields.IS_INVITE_ONLY: 'Yes',
             EventFields.START_DATE_TIME: IN_THE_FUTURE
         },
     ]
     assertContainsErrorIDs(
         self, ['38305945', '150925098'],
         events_are_invite_only_iff_not_university_wide(event_data))
 def test_incomplete_past_appointments(self):
     appt_data = [
         {
             AppointmentFields.ID: "6352432",
             AppointmentFields.START_DATE_TIME: "2018-05-28 15:30:00",
             AppointmentFields.END_DATE_TIME: "2018-05-28 16:00:00",
             AppointmentFields.STATUS: "approved",
             AppointmentFields.STAFF_MEMBER_FIRST_NAME: "Alex",
             AppointmentFields.STAFF_MEMBER_LAST_NAME: "Vanderbildt"
         },
         {
             AppointmentFields.ID: "290392059",
             AppointmentFields.START_DATE_TIME: "2015-12-08 10:00:00",
             AppointmentFields.END_DATE_TIME: "2015-12-08 10:30:00",
             AppointmentFields.STATUS: "started",
             AppointmentFields.STAFF_MEMBER_FIRST_NAME: "Mary",
             AppointmentFields.STAFF_MEMBER_LAST_NAME: "Smith"
         },
         {
             AppointmentFields.ID: "18536335",
             AppointmentFields.START_DATE_TIME: "2016-08-19 13:00:00",
             AppointmentFields.END_DATE_TIME: "2016-08-19 13:30:00",
             AppointmentFields.STATUS: "completed",
             AppointmentFields.STAFF_MEMBER_FIRST_NAME: "Jess",
             AppointmentFields.STAFF_MEMBER_LAST_NAME: "Walker"
         },
     ]
     assertContainsErrorIDs(
         self, ['6352432', '290392059'],
         past_appointments_have_finalized_status(appt_data))
Ejemplo n.º 3
0
 def test_cancelled_prefix_is_valid(self):
     event_data = [
         {
             EventFields.ID: "353242",
             EventFields.NAME:
             "CANCELLED: University-Wide: 2019 JumpStart STEM Diversity Forum",
             EventFields.CAREER_CENTER: CareerCenters.HOMEWOOD
         },
         {
             EventFields.ID: "8563254",
             EventFields.NAME:
             "CANCELLED: Carey: Drop-in Mondays HE September 9th Afternoon",
             EventFields.CAREER_CENTER: CareerCenters.CAREY
         },
         {
             EventFields.ID: "902820",
             EventFields.NAME: "CANCELLED: Career Clinic: Job Negotiation",
             EventFields.CAREER_CENTER: CareerCenters.PDCO
         },
         {
             EventFields.ID: "2635346",
             EventFields.NAME: "CANCELLED: SAISLeads Retreat",
             EventFields.CAREER_CENTER: CareerCenters.SAIS
         },
     ]
     assertContainsErrorIDs(
         self, ['902820', '2635346'],
         jhu_owned_events_are_prefixed_correctly(event_data))
Ejemplo n.º 4
0
 def test_university_wide_events(self):
     event_data = [
         {
             EventFields.ID: "6336475",
             EventFields.NAME: "University-Wide: Consulting Alumni Panel",
             EventFields.CAREER_CENTER: CareerCenters.HOMEWOOD,
             EventFields.IS_INVITE_ONLY: 'No',
             EventFields.START_DATE_TIME: IN_THE_FUTURE
         },
         {
             EventFields.ID: "9892820",
             EventFields.NAME: "University-Wide: Resume Workshop",
             EventFields.CAREER_CENTER: CareerCenters.CAREY,
             EventFields.IS_INVITE_ONLY: 'No',
             EventFields.START_DATE_TIME: IN_THE_FUTURE
         },
         {
             EventFields.ID: "8290282",
             EventFields.NAME: "University-Wide: Resume Workshop",
             EventFields.CAREER_CENTER: CareerCenters.PDCO,
             EventFields.IS_INVITE_ONLY: 'Yes',
             EventFields.START_DATE_TIME: IN_THE_FUTURE
         },
     ]
     assertContainsErrorIDs(
         self, ['8290282'],
         events_are_invite_only_iff_not_university_wide(event_data))
Ejemplo n.º 5
0
 def test_with_all_event_types(self):
     event_data = [
         {
             EventFields.ID: "288569",
             EventFields.NAME:
             "Homewood: 2019 JumpStart STEM Diversity Forum",
             EventFields.CAREER_CENTER: CareerCenters.HOMEWOOD
         },
         {
             EventFields.ID: "331585",
             EventFields.NAME:
             "Carey: Drop-in Mondays HE September 9th Afternoon",
             EventFields.CAREER_CENTER: CareerCenters.CAREY
         },
         {
             EventFields.ID: "333931",
             EventFields.NAME: "PDCO: Career Clinic: Job Negotiation",
             EventFields.CAREER_CENTER: CareerCenters.PDCO
         },
         {
             EventFields.ID: '526433',
             EventFields.NAME: 'N: How to Find Your First Nursing Job',
             EventFields.CAREER_CENTER: CareerCenters.NURSING
         },
         {
             EventFields.ID: '328092',
             EventFields.NAME:
             'Strategies for Effective Professional Communication webinar',
             EventFields.CAREER_CENTER: CareerCenters.AAP
         },
         {
             EventFields.ID: '940935',
             EventFields.NAME: 'Homewood: LAUNCH @ Lunch',
             EventFields.CAREER_CENTER: CareerCenters.PEABODY
         },
         {
             EventFields.ID: "83257925",
             EventFields.NAME: "Deloitte Virtual Session",
             EventFields.CAREER_CENTER: None
         },
         {
             EventFields.ID: "4324725",
             EventFields.NAME: "McKinsey Virtual Session",
             EventFields.CAREER_CENTER: None
         },
         {
             EventFields.ID: "12980293",
             EventFields.NAME: "Google On-Site",
             EventFields.CAREER_CENTER: None
         },
     ]
     assertContainsErrorIDs(
         self, ['526433', '328092', '940935'],
         jhu_owned_events_are_prefixed_correctly(event_data))
Ejemplo n.º 6
0
 def test_past_jhu_events_with_virtual_event_type_are_not_ok(self):
     events = [{
         EventFields.ID: '354987',
         EventFields.NAME: 'Homewood: Deloitte Info Session',
         EventFields.CAREER_CENTER: CareerCenters.HOMEWOOD,
         EventFields.EVENT_TYPE: 'Virtual Session',
         EventFields.START_DATE_TIME: IN_THE_PAST
     }]
     result = past_events_do_not_have_virtual_event_type(events)
     assertContainsErrorIDs(self, ['354987'], result)
     self.assertEqual(
         'Event 354987 (Homewood: Deloitte Info Session) should not have the "Virtual Session" event type',
         result.errors[0]['error_msg'])
Ejemplo n.º 7
0
 def test_homewood_office_hours_without_the_advertisement_label_are_not_ok(
         self):
     events = [
         {
             EventFields.ID: "333931",
             EventFields.NAME: "Homewood: STEM Office Hours",
             EventFields.CAREER_CENTER: CareerCenters.HOMEWOOD,
             EventFields.EVENT_TYPE: 'Other',
             EventFields.LABELS_LIST: 'shared: in-person',
             EventFields.START_DATE_TIME: IN_THE_FUTURE
         },
     ]
     result = advertisement_events_are_labeled(events)
     assertContainsErrorIDs(self, ['333931'], result)
     self.assertEqual(
         'Event 333931 (Homewood: STEM Office Hours) should be labeled "shared: advertisement"',
         result.errors[0]['error_msg'])
Ejemplo n.º 8
0
 def test_canceled_misspelling_gives_helpful_feedback(self):
     event_data = [{
         EventFields.ID: "902820",
         EventFields.NAME: "CANCELED: PDCO: Career Clinic: Job Negotiation",
         EventFields.CAREER_CENTER: CareerCenters.PDCO
     }, {
         EventFields.ID: "2635346",
         EventFields.NAME: "CAnCELEd: SAIS: SAISLeads Retreat",
         EventFields.CAREER_CENTER: CareerCenters.SAIS
     }, {
         EventFields.ID: "3263343",
         EventFields.NAME: "Cancelled: Peabody: Launch Event",
         EventFields.CAREER_CENTER: CareerCenters.PEABODY
     }]
     assertContainsErrorIDs(
         self, ['902820', '2635346', '3263343'],
         jhu_owned_events_are_prefixed_correctly(event_data))
Ejemplo n.º 9
0
 def test_past_homewood_office_hours_with_the_event_type_virtual_session_are_not_ok(
         self):
     events = [
         {
             EventFields.ID: "948648",
             EventFields.NAME: "Homewood: Office Hours",
             EventFields.CAREER_CENTER: CareerCenters.HOMEWOOD,
             EventFields.EVENT_TYPE: 'Virtual Session',
             EventFields.LABELS_LIST:
             'shared: in-person, shared: advertisement',
             EventFields.START_DATE_TIME: IN_THE_PAST
         },
     ]
     result = advertisement_events_are_labeled(events)
     assertContainsErrorIDs(self, ['948648'], result)
     self.assertEqual(
         'Event 948648 (Homewood: Office Hours) should have event type "Other"',
         result.errors[0]['error_msg'])
Ejemplo n.º 10
0
 def test_with_one_of_each_bad_event(self):
     event_data = [{
         EventFields.ID: "353242",
         EventFields.NAME: "Homewoo: 2019 JumpStart STEM Diversity Forum",
         EventFields.CAREER_CENTER: CareerCenters.HOMEWOOD
     }, {
         EventFields.ID: "8563254",
         EventFields.NAME:
         "Cary: Drop-in Mondays HE September 9th Afternoon",
         EventFields.CAREER_CENTER: CareerCenters.CAREY
     }, {
         EventFields.ID: "902820",
         EventFields.NAME: "Univ. Wide: Career Clinic: Job Negotiation",
         EventFields.CAREER_CENTER: CareerCenters.PDCO
     }, {
         EventFields.ID: "2635346",
         EventFields.NAME: "SAIS Europe SAISLeads Retreat",
         EventFields.CAREER_CENTER: CareerCenters.SAIS
     }, {
         EventFields.ID: '526433',
         EventFields.NAME: 'N: How to Find Your First Nursing Job',
         EventFields.CAREER_CENTER: CareerCenters.NURSING
     }, {
         EventFields.ID: '328092',
         EventFields.NAME:
         'Strategies for Effective Professional Communication webinar',
         EventFields.CAREER_CENTER: CareerCenters.AAP
     }, {
         EventFields.ID: '940935',
         EventFields.NAME: 'Homewood: LAUNCH @ Lunch',
         EventFields.CAREER_CENTER: CareerCenters.PEABODY
     }, {
         EventFields.ID: '5839252',
         EventFields.NAME: 'BSP: Student Activities Fair',
         EventFields.CAREER_CENTER: CareerCenters.BSPH
     }]
     expected_error_ids = [
         '353242', '8563254', '902820', '2635346', '526433', '328092',
         '940935', '5839252'
     ]
     assertContainsErrorIDs(
         self, expected_error_ids,
         jhu_owned_events_are_prefixed_correctly(event_data))
Ejemplo n.º 11
0
 def test_test_prefix_is_valid(self):
     event_data = [
         {
             EventFields.ID: "3463254",
             EventFields.NAME: "Test: 2019 JumpStart STEM Diversity Forum",
             EventFields.CAREER_CENTER: CareerCenters.HOMEWOOD
         },
         {
             EventFields.ID: "5364354",
             EventFields.NAME:
             "test- Drop-in Mondays HE September 9th Afternoon",
             EventFields.CAREER_CENTER: CareerCenters.PDCO
         },
         {
             EventFields.ID: "26895576",
             EventFields.NAME: "TESTING Career Clinic: Job Negotiation",
             EventFields.CAREER_CENTER: CareerCenters.SAIS
         },
     ]
     assertContainsErrorIDs(
         self, ['5364354', '26895576'],
         jhu_owned_events_are_prefixed_correctly(event_data))
 def test_appointments_without_a_type(self):
     appt_data = [
         {
             AppointmentFields.ID: "6352432",
             AppointmentFields.START_DATE_TIME: "2018-05-28 15:30:00",
             AppointmentFields.END_DATE_TIME: "2018-05-28 16:00:00",
             AppointmentFields.STATUS: "approved",
             AppointmentFields.STAFF_MEMBER_FIRST_NAME: "Alex",
             AppointmentFields.STAFF_MEMBER_LAST_NAME: "Vanderbildt",
             AppointmentFields.TYPE: ""
         },
         {
             AppointmentFields.ID: "18536335",
             AppointmentFields.START_DATE_TIME: "2016-08-19 13:00:00",
             AppointmentFields.END_DATE_TIME: "2016-08-19 13:30:00",
             AppointmentFields.STATUS: "approved",
             AppointmentFields.STAFF_MEMBER_FIRST_NAME: "Mary",
             AppointmentFields.STAFF_MEMBER_LAST_NAME: "Smith",
             AppointmentFields.TYPE: None
         },
     ]
     assertContainsErrorIDs(self, ['6352432', '18536335'],
                            all_appointments_have_a_type(appt_data))
Ejemplo n.º 13
0
 def test_cancelled_prefix_doesnt_interefere(self):
     event_data = [
         {
             EventFields.ID: "353242",
             EventFields.NAME:
             "CANCELLED: University-Wide: 2019 JumpStart STEM Diversity Forum",
             EventFields.CAREER_CENTER: CareerCenters.HOMEWOOD,
             EventFields.IS_INVITE_ONLY: 'Yes',
             EventFields.START_DATE_TIME: IN_THE_FUTURE
         },
         {
             EventFields.ID: "8563254",
             EventFields.NAME:
             "CANCELLED: Carey: Drop-in Mondays HE September 9th Afternoon",
             EventFields.CAREER_CENTER: CareerCenters.CAREY,
             EventFields.IS_INVITE_ONLY: 'Yes',
             EventFields.START_DATE_TIME: IN_THE_FUTURE
         },
         {
             EventFields.ID: "902820",
             EventFields.NAME:
             "CANCELLED: University-Wide: Career Clinic: Job Negotiation",
             EventFields.CAREER_CENTER: CareerCenters.PDCO,
             EventFields.IS_INVITE_ONLY: 'No',
             EventFields.START_DATE_TIME: IN_THE_FUTURE
         },
         {
             EventFields.ID: "2635346",
             EventFields.NAME: "CANCELLED: SAIS DC: SAISLeads Retreat",
             EventFields.CAREER_CENTER: CareerCenters.SAIS,
             EventFields.IS_INVITE_ONLY: 'No',
             EventFields.START_DATE_TIME: IN_THE_FUTURE
         },
     ]
     assertContainsErrorIDs(
         self, ['353242', '2635346'],
         events_are_invite_only_iff_not_university_wide(event_data))