'Test that an empty `data` field is preserved through
export/import.'

def test_empty_data_roundtrip(self):

    content_store = contentstore()
    import_course_from_xml(self.store, self.user.id, TEST_DATA_DIR, ['toy'], create_if_not_present=True)
    course_id = self.store.make_course_key('edX', 'toy', '2012_Fall')
    verticals = self.store.get_items(course_id, qualifiers={'category': 'vertical'})
    self.assertGreater(len(verticals), 0)
    parent = verticals[0]
    word_cloud = ItemFactory.create(parent_location=parent.location, category='word_cloud', display_name='untitled')
    del word_cloud.data
    self.assertEquals(word_cloud.data, '')
    root_dir = path(mkdtemp_clean())
    export_course_to_xml(self.store, content_store, course_id, root_dir, 'test_roundtrip')
    import_course_from_xml(self.store, self.user.id, root_dir)
    imported_word_cloud = self.store.get_item(course_id.make_usage_key('word_cloud', 'untitled'))
    self.assertEquals(imported_word_cloud.data, '')
