'testing escape symbols occured in xml/rss document file.'

def test_escape_xml(self):

    re_symbols = re.compile('\\&\\#(x?[0-9a-fA-F]+);')
    ampersand_str = re_symbols.sub(ent2chr, '&#x26;')
    self.assertEqual(ampersand_str, '&', ('wrong    ampersand    conversion    %s' % ampersand_str))
    str_123 = re_symbols.sub(ent2chr, '&#x31;&#x32;&#x33;')
    self.assertEqual(str_123, '123', ('wrong    number    conversion    %s' % str_123))
