'Helper to create a split course with a published orphan'

def create_split_course_with_published_orphan(self):

    course = CourseFactory.create(default_store=ModuleStoreEnum.Type.split)
    orphan = self.store.create_item(self.user.id, course.id, 'html', 'PublishedOnlyOrphan')
    self.store.publish(orphan.location, self.user.id)
    published_branch = course.id.for_branch(ModuleStoreEnum.BranchName.published)
    self.assertOrphanCount(course.id, 1)
    self.assertOrphanCount(published_branch, 1)
    self.store.delete_item(orphan.location, self.user.id, skip_auto_publish=True)
    self.assertOrphanCount(course.id, 0)
    self.assertOrphanCount(published_branch, 1)
    self.assertIn(orphan, self.store.get_items(published_branch))
    return (course, orphan)
