def test_convert_unsafe_html(self): """ <script>alert('Hello');</script> & a "test" """ raw = "<script>alert('Hello');</script> & a \"test\"" result = make_html_safe(raw) expected = ('<script>alert('Hello');</script> ' + '& a "test"') self.assertEqual(result, expected)
def test_converts_doublequote(self): """ " becomes " """ result = make_html_safe('"') self.assertEqual(result, '"')
def test_converts_singlequote(self): """ ' becomes ' """ result = make_html_safe("'") self.assertEqual(result, ''')
def test_converts_greaterthan(self): """ > becomes > """ result = make_html_safe('>') self.assertEqual(result, '>')
def test_converts_lessthan(self): """ < becomes < """ result = make_html_safe('<') self.assertEqual(result, '<')
def test_converts_ampersand(self): """ & becomes & """ result = make_html_safe('&') self.assertEqual(result, '&')