'test updating an item\'s children ensuring the definition doesn\'t version but the course does if it should'

def test_update_children(self):

    locator = BlockUsageLocator(CourseLocator(org='testx', course='GreekHero', run='run', branch=BRANCH_NAME_DRAFT), 'chapter', 'chapter3')
    block = modulestore().get_item(locator)
    pre_def_id = block.definition_locator.definition_id
    pre_version_guid = block.location.version_guid
    self.assertGreater(len(block.children), 0, 'meaningless    test')
    moved_child = block.children.pop()
    block.save()
    updated_problem = modulestore().update_item(block, self.user_id)
    self.assertEqual(updated_problem.definition_locator.definition_id, pre_def_id)
    self.assertNotEqual(updated_problem.location.version_guid, pre_version_guid)
    self.assertEqual(version_agnostic(updated_problem.children), version_agnostic(block.children))
    self.assertNotIn(moved_child, version_agnostic(updated_problem.children))
    locator = locator.course_key.make_usage_key('chapter', 'chapter1')
    other_block = modulestore().get_item(locator)
    other_block.children.append(moved_child)
    other_updated = modulestore().update_item(other_block, self.user_id)
    self.assertIn(moved_child.version_agnostic(), version_agnostic(other_updated.children))
