def test_transform_nl_to_br(self):
     self.assertEquals(
         'Ch\xc3\xa4ck<br />',
         safe_html('<script>bad</script>Ch\xc3\xa4ck\n'))
 def test_returns_safe_html_with_unicode(self):
     self.assertEquals(
         'Ch\xc3\xa4ck',
         safe_html(u'<script>bad</script>Ch\xe4ck'))
 def test_returns_safe_html(self):
     self.assertEquals(
         'Ch\xc3\xa4ck',
         safe_html('<script>bad code</script>Ch\xc3\xa4ck'))
 def test_returns_empty_string_if_text_is_None(self):
     self.assertEquals('', safe_html(None))
Example #5
0
 def safe_html(self, text):
     return safe_html(text)