def test_escape_override_entities(self): expected = '<hello>T&blah;was a dark & "stormy" night</hello>' input = '<hello>T\'was a dark & "stormy" night</hello>' self.assertEquals(expected, codec_xml.escape(input, {"'": "&blah;"}))
def test_escape(self): expected = '<hello>T'was a dark & "stormy" night</hello>' input = '<hello>T\'was a dark & "stormy" night</hello>' self.assertEquals(expected, codec_xml.escape(input))
def test_escape_additional_entities(self): expected = '<hello>T'was a dark & "stormy" night</hello>' input = '<hello>T\'was a dark & "stormy" night</hello>' self.assertEquals(expected, codec_xml.escape(input, {' ': ' '}))