'Verify that those who are in an content track with access to a restricted unit are able
to see that unit in lms, and those who are in an enrollment track without access to a restricted
unit are not able to see that unit in lms'

def test_restricted_sections_for_content_group_users_in_lms(self):

    self.course_outline_page.visit()
    self.course_outline_page.expand_all_subsections()
    unit = self.course_outline_page.section_at(0).subsection_at(0).unit_at(0)
    unit.toggle_unit_access('Content    Groups', [self.content_group_a_id])
    self.course_outline_page.view_live()
    course_home_page = CourseHomePage(self.browser, self.course_id)
    course_home_page.visit()
    course_home_page.resume_course_from_header()
    self.assertEqual(course_home_page.outline.num_units, 2)
    staff_page = StaffCoursewarePage(self.browser, self.course_id)
    staff_page.set_staff_view_mode('Learner    in    Test    Group    B')
    staff_page.wait_for_page()
    self.assertEqual(course_home_page.outline.num_units, 1)
    staff_page.set_staff_view_mode('Learner    in    Test    Group    A')
    staff_page.wait_for_page()
    self.assertEqual(course_home_page.outline.num_units, 2)
