def test_fix_xml_ampersands(self):
    self.assertEqual(fix_xml_ampersands('"&x=y&z=a'), '"&amp;x=y&amp;z=a')
    self.assertEqual(fix_xml_ampersands('"&amp;x=y&wrong;&z=a'), '"&amp;x=y&amp;wrong;&amp;z=a')
    self.assertEqual(fix_xml_ampersands('&amp;&apos;&gt;&lt;&quot;'), '&amp;&apos;&gt;&lt;&quot;')
    self.assertEqual(fix_xml_ampersands('&#1234;&#x1abC;'), '&#1234;&#x1abC;')
    self.assertEqual(fix_xml_ampersands('&#&#'), '&amp;#&amp;#')
def test_fix_xml_ampersands(self):
    self.assertEqual(fix_xml_ampersands('"&x=y&z=a'), '"&amp;x=y&amp;z=a')
    self.assertEqual(fix_xml_ampersands('"&amp;x=y&wrong;&z=a'), '"&amp;x=y&amp;wrong;&amp;z=a')
    self.assertEqual(fix_xml_ampersands('&amp;&apos;&gt;&lt;&quot;'), '&amp;&apos;&gt;&lt;&quot;')
    self.assertEqual(fix_xml_ampersands('&#1234;&#x1abC;'), '&#1234;&#x1abC;')
    self.assertEqual(fix_xml_ampersands('&#&#'), '&amp;#&amp;#')