'get_course_successors(course_locator, version_history_depth=1)'

@patch('xmodule.tabs.CourseTab.from_json', side_effect=mock_tab_from_json)
def test_course_successors(self, _from_json):

    locator = CourseLocator(org='testx', course='GreekHero', run='run', branch=BRANCH_NAME_DRAFT)
    course = modulestore().get_course(locator)
    versions = [course.location.version_guid, course.previous_version]
    locator = CourseLocator(version_guid=course.previous_version)
    course = modulestore().get_course(locator)
    versions.append(course.previous_version)
    locator = CourseLocator(version_guid=course.previous_version)
    result = modulestore().get_course_successors(locator)
    self.assertIsInstance(result, VersionTree)
    self.assertIsNone(result.locator.org)
    self.assertEqual(result.locator.version_guid, versions[(-1)])
    self.assertEqual(len(result.children), 1)
    self.assertEqual(result.children[0].locator.version_guid, versions[(-2)])
    self.assertEqual(len(result.children[0].children), 0, 'descended    more    than    one    level')
    result = modulestore().get_course_successors(locator, version_history_depth=2)
    self.assertEqual(len(result.children), 1)
    self.assertEqual(result.children[0].locator.version_guid, versions[(-2)])
    self.assertEqual(len(result.children[0].children), 1)
    result = modulestore().get_course_successors(locator, version_history_depth=99)
    self.assertEqual(len(result.children), 1)
    self.assertEqual(result.children[0].locator.version_guid, versions[(-2)])
    self.assertEqual(len(result.children[0].children), 1)
    self.assertEqual(result.children[0].children[0].locator.version_guid, versions[0])
