'Test that import works fine on split mongo after renaming the blocks url.'

def test_import_after_renaming_xml_data(self):

    split_store = modulestore()._get_modulestore_by_type(ModuleStoreEnum.Type.split)
    import_course_from_xml(split_store, self.user.id, TEST_DATA_DIR, ['course_before_rename'], create_if_not_present=True)
    course_after_rename = import_course_from_xml(split_store, self.user.id, TEST_DATA_DIR, ['course_after_rename'], create_if_not_present=True)
    all_items = split_store.get_items(course_after_rename[0].id, qualifiers={'category': 'chapter'})
    renamed_chapter = [item for item in all_items if (item.location.block_id == 'renamed_chapter')][0]
    self.assertIsNotNone(renamed_chapter.published_on)
    self.assertIsNotNone(renamed_chapter.parent)
    self.assertIn(renamed_chapter.location, course_after_rename[0].children)
    original_chapter = [item for item in all_items if (item.location.block_id == 'b9870b9af59841a49e6e02765d0e3bbf')][0]
    self.assertIsNone(original_chapter.published_on)
    self.assertIsNone(original_chapter.parent)
    self.assertNotIn(original_chapter.location, course_after_rename[0].children)
