Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
a6433972
Commit
a6433972
authored
Feb 23, 2015
by
Dino Cikatic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SOL-259 Change HTML content listed type in index from HTML Content to Text
parent
e5039b8c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
common/lib/xmodule/xmodule/html_module.py
+1
-1
common/lib/xmodule/xmodule/tests/test_html_module.py
+5
-5
No files found.
common/lib/xmodule/xmodule/html_module.py
View file @
a6433972
...
@@ -270,7 +270,7 @@ class HtmlDescriptor(HtmlFields, XmlDescriptor, EditingDescriptor):
...
@@ -270,7 +270,7 @@ class HtmlDescriptor(HtmlFields, XmlDescriptor, EditingDescriptor):
xblock_body
[
"content"
]
.
update
(
html_body
)
xblock_body
[
"content"
]
.
update
(
html_body
)
else
:
else
:
xblock_body
[
"content"
]
=
html_body
xblock_body
[
"content"
]
=
html_body
xblock_body
[
"content_type"
]
=
"
HTML Conten
t"
xblock_body
[
"content_type"
]
=
"
Tex
t"
return
xblock_body
return
xblock_body
...
...
common/lib/xmodule/xmodule/tests/test_html_module.py
View file @
a6433972
...
@@ -68,7 +68,7 @@ class HtmlDescriptorIndexingTestCase(unittest.TestCase):
...
@@ -68,7 +68,7 @@ class HtmlDescriptorIndexingTestCase(unittest.TestCase):
descriptor
=
instantiate_descriptor
(
data
=
sample_xml
)
descriptor
=
instantiate_descriptor
(
data
=
sample_xml
)
self
.
assertEqual
(
descriptor
.
index_dictionary
(),
{
self
.
assertEqual
(
descriptor
.
index_dictionary
(),
{
"content"
:
{
"html_content"
:
" Hello World! "
,
"display_name"
:
"Text"
},
"content"
:
{
"html_content"
:
" Hello World! "
,
"display_name"
:
"Text"
},
"content_type"
:
"
HTML Conten
t"
"content_type"
:
"
Tex
t"
})
})
sample_xml_cdata
=
'''
sample_xml_cdata
=
'''
...
@@ -80,7 +80,7 @@ class HtmlDescriptorIndexingTestCase(unittest.TestCase):
...
@@ -80,7 +80,7 @@ class HtmlDescriptorIndexingTestCase(unittest.TestCase):
descriptor
=
instantiate_descriptor
(
data
=
sample_xml_cdata
)
descriptor
=
instantiate_descriptor
(
data
=
sample_xml_cdata
)
self
.
assertEqual
(
descriptor
.
index_dictionary
(),
{
self
.
assertEqual
(
descriptor
.
index_dictionary
(),
{
"content"
:
{
"html_content"
:
" This has CDATA in it. "
,
"display_name"
:
"Text"
},
"content"
:
{
"html_content"
:
" This has CDATA in it. "
,
"display_name"
:
"Text"
},
"content_type"
:
"
HTML Conten
t"
"content_type"
:
"
Tex
t"
})
})
sample_xml_tab_spaces
=
'''
sample_xml_tab_spaces
=
'''
...
@@ -91,7 +91,7 @@ class HtmlDescriptorIndexingTestCase(unittest.TestCase):
...
@@ -91,7 +91,7 @@ class HtmlDescriptorIndexingTestCase(unittest.TestCase):
descriptor
=
instantiate_descriptor
(
data
=
sample_xml_tab_spaces
)
descriptor
=
instantiate_descriptor
(
data
=
sample_xml_tab_spaces
)
self
.
assertEqual
(
descriptor
.
index_dictionary
(),
{
self
.
assertEqual
(
descriptor
.
index_dictionary
(),
{
"content"
:
{
"html_content"
:
" Text has spaces :) "
,
"display_name"
:
"Text"
},
"content"
:
{
"html_content"
:
" Text has spaces :) "
,
"display_name"
:
"Text"
},
"content_type"
:
"
HTML Conten
t"
"content_type"
:
"
Tex
t"
})
})
sample_xml_comment
=
'''
sample_xml_comment
=
'''
...
@@ -103,7 +103,7 @@ class HtmlDescriptorIndexingTestCase(unittest.TestCase):
...
@@ -103,7 +103,7 @@ class HtmlDescriptorIndexingTestCase(unittest.TestCase):
descriptor
=
instantiate_descriptor
(
data
=
sample_xml_comment
)
descriptor
=
instantiate_descriptor
(
data
=
sample_xml_comment
)
self
.
assertEqual
(
descriptor
.
index_dictionary
(),
{
self
.
assertEqual
(
descriptor
.
index_dictionary
(),
{
"content"
:
{
"html_content"
:
" This has HTML comment in it. "
,
"display_name"
:
"Text"
},
"content"
:
{
"html_content"
:
" This has HTML comment in it. "
,
"display_name"
:
"Text"
},
"content_type"
:
"
HTML Conten
t"
"content_type"
:
"
Tex
t"
})
})
sample_xml_mix_comment_cdata
=
'''
sample_xml_mix_comment_cdata
=
'''
...
@@ -118,5 +118,5 @@ class HtmlDescriptorIndexingTestCase(unittest.TestCase):
...
@@ -118,5 +118,5 @@ class HtmlDescriptorIndexingTestCase(unittest.TestCase):
descriptor
=
instantiate_descriptor
(
data
=
sample_xml_mix_comment_cdata
)
descriptor
=
instantiate_descriptor
(
data
=
sample_xml_mix_comment_cdata
)
self
.
assertEqual
(
descriptor
.
index_dictionary
(),
{
self
.
assertEqual
(
descriptor
.
index_dictionary
(),
{
"content"
:
{
"html_content"
:
" This has HTML comment in it. HTML end. "
,
"display_name"
:
"Text"
},
"content"
:
{
"html_content"
:
" This has HTML comment in it. HTML end. "
,
"display_name"
:
"Text"
},
"content_type"
:
"
HTML Conten
t"
"content_type"
:
"
Tex
t"
})
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment