"""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 paragraph. """ assert escape_html_characters(html_content) == self.final_content def test_escape_cdata_comments(self): html_content = """ This is a paragraph. """ assert escape_html_characters(html_content) == self.final_content def test_escape_non_breaking_space(self): html_content = """      This is a paragraph.  """ assert escape_html_characters(html_content) == self.final_content