Exemplo n.º 1
0
 def test_homewood_events_without_office_hours_in_the_name_are_ok(self):
     events = [
         {
             EventFields.ID: "333931",
             EventFields.NAME: "Homewood: Job Negotiation Workshop",
             EventFields.CAREER_CENTER: CareerCenters.HOMEWOOD,
             EventFields.EVENT_TYPE: 'Workshop',
             EventFields.LABELS_LIST: '',
             EventFields.START_DATE_TIME: IN_THE_FUTURE
         },
     ]
     assertIsVerified(self, advertisement_events_are_labeled(events))
Exemplo n.º 2
0
 def test_non_homewood_events_are_ok(self):
     events = [
         {
             EventFields.ID: "331585",
             EventFields.NAME: "PDCO: Office Hours",
             EventFields.CAREER_CENTER: CareerCenters.PDCO,
             EventFields.EVENT_TYPE: 'Workshop',
             EventFields.LABELS_LIST: '',
             EventFields.START_DATE_TIME: IN_THE_PAST
         },
     ]
     assertIsVerified(self, advertisement_events_are_labeled(events))
Exemplo n.º 3
0
 def test_upcoming_homewood_office_hours_with_the_event_type_virtual_session_are_ok(
         self):
     events = [
         {
             EventFields.ID: "333931",
             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_FUTURE
         },
     ]
     assertIsVerified(self, advertisement_events_are_labeled(events))
Exemplo n.º 4
0
 def test_homewood_office_hours_with_the_advertisement_label_and_event_type_of_other_are_ok(
         self):
     events = [
         {
             EventFields.ID: "333931",
             EventFields.NAME: "Homewood: Office Hours",
             EventFields.CAREER_CENTER: CareerCenters.HOMEWOOD,
             EventFields.EVENT_TYPE: 'Other',
             EventFields.LABELS_LIST:
             'shared: in-person, shared: advertisement',
             EventFields.START_DATE_TIME: IN_THE_PAST
         },
     ]
     assertIsVerified(self, advertisement_events_are_labeled(events))
Exemplo n.º 5
0
 def test_homewood_office_hours_without_correct_label_or_event_type_produce_a_compound_error_message(
         self):
     events = [
         {
             EventFields.ID: "948648",
             EventFields.NAME: "Homewood: KSAS Office Hours",
             EventFields.CAREER_CENTER: CareerCenters.HOMEWOOD,
             EventFields.EVENT_TYPE: 'Group Appointment',
             EventFields.LABELS_LIST: '',
             EventFields.START_DATE_TIME: IN_THE_PAST
         },
     ]
     actual_error_msg = advertisement_events_are_labeled(
         events).errors[0]['error_msg']
     self.assertEqual(
         'Event 948648 (Homewood: KSAS Office Hours) should be labeled "shared: advertisement" and have event type "Other"',
         actual_error_msg)
Exemplo n.º 6
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'])
Exemplo n.º 7
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'])