refactor: move xmodule folder to root
- Moving xmodule folder to root as we're dissolving sub-projects of common folder in edx-platform
- More info: https://openedx.atlassian.net/browse/BOM-2579
- -e common/lib/xmodule has been removed from the requirements as xmodule has itself become the part of edx-platform and not being installed through requirements
- The test files common/lib/xmodule/test_files/ have been removed as they are not being used anymore
This commit is contained in:
63
xmodule/tests/test_utils_escape_html_characters.py
Normal file
63
xmodule/tests/test_utils_escape_html_characters.py
Normal file
@@ -0,0 +1,63 @@
|
||||
"""Tests for methods defined in util/misc.py"""
|
||||
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
from xmodule.util.misc import escape_html_characters
|
||||
|
||||
|
||||
class UtilHtmlEscapeTests(TestCase):
|
||||
"""
|
||||
Tests for methods exposed in util/misc
|
||||
"""
|
||||
|
||||
final_content = " This is a paragraph. "
|
||||
|
||||
def test_escape_html_comments(self):
|
||||
html_content = """
|
||||
<!--This is a comment. Comments are not displayed in the browser-->
|
||||
|
||||
This is a paragraph.
|
||||
"""
|
||||
assert escape_html_characters(html_content) == self.final_content
|
||||
|
||||
def test_escape_cdata_comments(self):
|
||||
html_content = """
|
||||
<![CDATA[
|
||||
function matchwo(a,b)
|
||||
{
|
||||
if (a < b && a < 0) then
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
]]>
|
||||
|
||||
This is a paragraph.
|
||||
"""
|
||||
assert escape_html_characters(html_content) == self.final_content
|
||||
|
||||
def test_escape_non_breaking_space(self):
|
||||
html_content = """
|
||||
|
||||
|
||||
<![CDATA[
|
||||
function matchwo(a,b)
|
||||
{
|
||||
if (a < b && a < 0) then
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
]]>
|
||||
This is a paragraph.
|
||||
"""
|
||||
assert escape_html_characters(html_content) == self.final_content
|
||||
Reference in New Issue
Block a user