SOL-259 Change HTML content listed type in index from HTML Content to Text

This commit is contained in:
Dino Cikatic
2015-02-23 13:30:14 +01:00
parent e5039b8c24
commit a643397275
2 changed files with 6 additions and 6 deletions

View File

@@ -270,7 +270,7 @@ class HtmlDescriptor(HtmlFields, XmlDescriptor, EditingDescriptor):
xblock_body["content"].update(html_body)
else:
xblock_body["content"] = html_body
xblock_body["content_type"] = "HTML Content"
xblock_body["content_type"] = "Text"
return xblock_body

View File

@@ -68,7 +68,7 @@ class HtmlDescriptorIndexingTestCase(unittest.TestCase):
descriptor = instantiate_descriptor(data=sample_xml)
self.assertEqual(descriptor.index_dictionary(), {
"content": {"html_content": " Hello World! ", "display_name": "Text"},
"content_type": "HTML Content"
"content_type": "Text"
})
sample_xml_cdata = '''
@@ -80,7 +80,7 @@ class HtmlDescriptorIndexingTestCase(unittest.TestCase):
descriptor = instantiate_descriptor(data=sample_xml_cdata)
self.assertEqual(descriptor.index_dictionary(), {
"content": {"html_content": " This has CDATA in it. ", "display_name": "Text"},
"content_type": "HTML Content"
"content_type": "Text"
})
sample_xml_tab_spaces = '''
@@ -91,7 +91,7 @@ class HtmlDescriptorIndexingTestCase(unittest.TestCase):
descriptor = instantiate_descriptor(data=sample_xml_tab_spaces)
self.assertEqual(descriptor.index_dictionary(), {
"content": {"html_content": " Text has spaces :) ", "display_name": "Text"},
"content_type": "HTML Content"
"content_type": "Text"
})
sample_xml_comment = '''
@@ -103,7 +103,7 @@ class HtmlDescriptorIndexingTestCase(unittest.TestCase):
descriptor = instantiate_descriptor(data=sample_xml_comment)
self.assertEqual(descriptor.index_dictionary(), {
"content": {"html_content": " This has HTML comment in it. ", "display_name": "Text"},
"content_type": "HTML Content"
"content_type": "Text"
})
sample_xml_mix_comment_cdata = '''
@@ -118,5 +118,5 @@ class HtmlDescriptorIndexingTestCase(unittest.TestCase):
descriptor = instantiate_descriptor(data=sample_xml_mix_comment_cdata)
self.assertEqual(descriptor.index_dictionary(), {
"content": {"html_content": " This has HTML comment in it. HTML end. ", "display_name": "Text"},
"content_type": "HTML Content"
"content_type": "Text"
})