Ejemplo n.º 1
0
    def test_link_to_event_valid_instructor_name(self, event):
        #ARRANGE
        studio_1 = Studio()
        studio_1.save()
        studio_2 = Studio()
        studio_2.save()
        instructor = Instructor()
        instructor.aliases_list = list([
            'Aimee McCabe - Karr',
        ])
        instructor.name_url = 'test_link_to_event_valid_instructor_name2'
        instructor.save()
        instructor.studios.add(studio_1)
        event.instructor_name = ' Teacher_AMK '
        event.studio = studio_2

        #ACT
        instructor.link_to_event(event)
        new_aliases_list = instructor.aliases_list
        new_studio_list = instructor.studios

        #ASSERT
        self.assertIsNotNone(new_aliases_list)
        self.assertEqual(len(new_aliases_list), 2)
        self.assertIn('Teacher_AMK', new_aliases_list)
        self.assertIsNotNone(new_studio_list)
        self.assertEqual(new_studio_list.count(), 2)
Ejemplo n.º 2
0
    def test_link_to_event_invalid_instructor_name(self, event):
        #ARRANGE
        instructor = Instructor()
        instructor.aliases_list = list([
            'Aimee McCabe - Karr',
        ])
        event.instructor_name = ' TBA '

        #ACT
        instructor.link_to_event(event)
        new_aliases_list = instructor.aliases_list

        #ASSERT
        self.assertIsNotNone(instructor)
        self.assertEqual(len(new_aliases_list), 1)
        self.assertIn('Aimee McCabe - Karr', new_aliases_list)