'Test the existing get_children method on xdescriptors'

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

    locator = BlockUsageLocator(CourseLocator(org='testx', course='GreekHero', run='run', branch=BRANCH_NAME_DRAFT), 'course', 'head12345')
    block = modulestore().get_item(locator)
    children = block.get_children()
    expected_ids = ['chapter1', 'chap', 'chapter2', 'chapter3']
    for child in children:
        self.assertEqual(child.category, 'chapter')
        self.assertIn(child.location.block_id, expected_ids)
        expected_ids.remove(child.location.block_id)
    self.assertEqual(len(expected_ids), 0)
