本文整理匯總了Python中xmodule.open_ended_grading_classes.openendedchild.OpenEndedChild.sanitize_html方法的典型用法代碼示例。如果您正苦於以下問題:Python OpenEndedChild.sanitize_html方法的具體用法?Python OpenEndedChild.sanitize_html怎麽用?Python OpenEndedChild.sanitize_html使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類xmodule.open_ended_grading_classes.openendedchild.OpenEndedChild
的用法示例。
在下文中一共展示了OpenEndedChild.sanitize_html方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_combined
# 需要導入模塊: from xmodule.open_ended_grading_classes.openendedchild import OpenEndedChild [as 別名]
# 或者: from xmodule.open_ended_grading_classes.openendedchild.OpenEndedChild import sanitize_html [as 別名]
def test_combined(self):
"""
tests a combination of inputs
"""
test_input = u"{}\n{}\n{}\n\n{}{}\n{}".format(self.link_text,
self.text,
self.script_dirty,
self.embed_dirty,
self.text_lessthan_noencd,
self.img_dirty)
test_output = u"{}<br/>{}<br/>{}<br/><br/>{}{}<br/>{}".format(self.link_atag,
self.text,
self.script_clean,
self.embed_clean,
self.text_lessthan_encode,
self.img_clean)
self.assertEqual(OpenEndedChild.sanitize_html(test_input), test_output)
示例2: test_linkify
# 需要導入模塊: from xmodule.open_ended_grading_classes.openendedchild import OpenEndedChild [as 別名]
# 或者: from xmodule.open_ended_grading_classes.openendedchild.OpenEndedChild import sanitize_html [as 別名]
def test_linkify(self):
"""
tests the replace_newlines function
"""
self.assertEqual(OpenEndedChild.sanitize_html(self.link_text), self.link_atag)
示例3: test_lessthan
# 需要導入模塊: from xmodule.open_ended_grading_classes.openendedchild import OpenEndedChild [as 別名]
# 或者: from xmodule.open_ended_grading_classes.openendedchild.OpenEndedChild import sanitize_html [as 別名]
def test_lessthan(self):
"""
Tests that `<` in text context is handled properly
"""
self.assertEqual(OpenEndedChild.sanitize_html(self.text_lessthan_noencd), self.text_lessthan_encode)
示例4: test_text
# 需要導入模塊: from xmodule.open_ended_grading_classes.openendedchild import OpenEndedChild [as 別名]
# 或者: from xmodule.open_ended_grading_classes.openendedchild.OpenEndedChild import sanitize_html [as 別名]
def test_text(self):
"""
Test for passing through text unchanged, including unicode
"""
self.assertEqual(OpenEndedChild.sanitize_html(self.text), self.text)
示例5: test_iframe
# 需要導入模塊: from xmodule.open_ended_grading_classes.openendedchild import OpenEndedChild [as 別名]
# 或者: from xmodule.open_ended_grading_classes.openendedchild.OpenEndedChild import sanitize_html [as 別名]
def test_iframe(self):
"""
Basic test for passing through iframe, but stripping bad attr
"""
self.assertEqual(OpenEndedChild.sanitize_html(self.iframe_dirty), self.iframe_clean)
示例6: test_embed
# 需要導入模塊: from xmodule.open_ended_grading_classes.openendedchild import OpenEndedChild [as 別名]
# 或者: from xmodule.open_ended_grading_classes.openendedchild.OpenEndedChild import sanitize_html [as 別名]
def test_embed(self):
"""
Basic test for passing through embed, but stripping bad attr
"""
self.assertEqual(OpenEndedChild.sanitize_html(self.embed_dirty), self.embed_clean)
示例7: test_script
# 需要導入模塊: from xmodule.open_ended_grading_classes.openendedchild import OpenEndedChild [as 別名]
# 或者: from xmodule.open_ended_grading_classes.openendedchild.OpenEndedChild import sanitize_html [as 別名]
def test_script(self):
"""
Basic test for stripping <script>
"""
self.assertEqual(OpenEndedChild.sanitize_html(self.script_dirty), self.script_clean)