'Make sure that path_to_location works with a component having multiple chapter parents,
from which one of them is orphan
course
chapter   chapter
vertical  vertical
html'

@ddt.data(ModuleStoreEnum.Type.split)
def test_path_to_location_for_orphan_chapter(self, module_store):

    course = self.create_course_with_orphans(module_store)
    orphan_chapter = self.store.get_item(BlockUsageLocator(course.id, 'chapter', 'OrphanChapter'))
    chapter1 = self.store.get_item(BlockUsageLocator(course.id, 'chapter', 'Chapter1'))
    vertical1 = self.store.get_item(BlockUsageLocator(course.id, 'vertical', 'Vertical1'))
    self.assertIn(orphan_chapter.location, self.store.get_orphans(course.id))
    vertical0 = self.store.create_child(self.user.id, orphan_chapter.location, 'vertical', 'Vertical0')
    self.store.publish(vertical0.location, self.user.id)
    html = self.store.create_child(self.user.id, vertical0.location, 'html', 'HTML0')
    self.store.publish(html.location, self.user.id)
    vertical1_parent = self.store.get_parent_location(vertical1.location)
    self.assertEqual(unicode(vertical1_parent), unicode(chapter1.location))
    vertical1.children.append(html.location)
    self.store.update_item(vertical1, self.user.id)
    html_parent = self.store.get_parent_location(html.location)
    self.assertEquals(unicode(html_parent), unicode(vertical1.location))
    path = path_to_location(self.store, html.location)
    expected_path = (course.id, chapter1.location.block_id, vertical1.location.block_id, html.location.block_id, '', path[(-1)])
    self.assertIsNotNone(path)
    self.assertEqual(len(path), 6)
    self.assertEqual(path, expected_path)
