def test_one_course_mode(self):
     """
     The purpose of this test is to ensure that when there is 1 or fewer course modes
     the enrollment track section is not shown.
     """
     add_enrollment_course_modes(self.browser, self.course_id, ['audit'])
     group_configurations_page = GroupConfigurationsPage(
         self.browser, self.course_info['org'], self.course_info['number'],
         self.course_info['run'])
     group_configurations_page.visit()
     self.assertFalse(
         group_configurations_page.enrollment_track_section_present)
     groups = group_configurations_page.get_enrollment_groups()
     self.assertEqual(len(groups), 0)
 def test_one_course_mode(self):
     """
     The purpose of this test is to ensure that when there is 1 or fewer course modes
     the enrollment track section is not shown.
     """
     add_enrollment_course_modes(self.browser, self.course_id, ['audit'])
     group_configurations_page = GroupConfigurationsPage(
         self.browser,
         self.course_info['org'],
         self.course_info['number'],
         self.course_info['run']
     )
     group_configurations_page.visit()
     self.assertFalse(group_configurations_page.enrollment_track_section_present)
     groups = group_configurations_page.get_enrollment_groups()
     self.assertEqual(len(groups), 0)
    def test_all_course_modes_present(self):
        """
        This test is meant to ensure that all the course modes show up as groups
        on the Group configuration page within the Enrollment Tracks section.
        It also checks to make sure that the edit buttons are not available.
        """
        add_enrollment_course_modes(self.browser, self.course_id, ['audit', 'verified'])
        group_configurations_page = GroupConfigurationsPage(
            self.browser,
            self.course_info['org'],
            self.course_info['number'],
            self.course_info['run']
        )
        group_configurations_page.visit()
        self.assertTrue(group_configurations_page.enrollment_track_section_present)

        # Make sure the edit buttons are not available.
        self.assertFalse(group_configurations_page.enrollment_track_edit_present)
        groups = group_configurations_page.get_enrollment_groups()
        for g in [self.audit_track, self.verified_track]:
            self.assertTrue(g in groups)
    def test_all_course_modes_present(self):
        """
        This test is meant to ensure that all the course modes show up as groups
        on the Group configuration page within the Enrollment Tracks section.
        It also checks to make sure that the edit buttons are not available.
        """
        add_enrollment_course_modes(self.browser, self.course_id, ['audit', 'verified'])
        group_configurations_page = GroupConfigurationsPage(
            self.browser,
            self.course_info['org'],
            self.course_info['number'],
            self.course_info['run']
        )
        group_configurations_page.visit()
        self.assertTrue(group_configurations_page.enrollment_track_section_present)

        # Make sure the edit buttons are not available.
        self.assertFalse(group_configurations_page.enrollment_track_edit_present)
        groups = group_configurations_page.get_enrollment_groups()
        for g in [self.audit_track, self.verified_track]:
            self.assertTrue(g in groups)