def test_xml_conversion(self):
    "\n            Test that converted XML hasn't changed from saved version.\n        "
    tree_string = StringIO.StringIO()
    self.pdf.tree.write(tree_string, pretty_print=True, encoding='utf-8')
    tree_string = tree_string.getvalue()
    comparison_file = ('tests/saved_output/IRS_1040A_output%s.xml' % ('_python_2.6' if ((sys.version_info[0] == 2) and (sys.version_info[1] < 7)) else ''))
    with open(comparison_file, 'rb') as f:
        saved_string = f.read()
    if (tree_string != saved_string):
        with open('tests/failed_output.xml', 'wb') as out:
            out.write(tree_string)
        self.fail(('XML conversion of sample pdf has changed! Compare %s to tests/failed_output.xml.' % comparison_file))
Test that converted XML hasn't changed from saved version.
def test_xml_conversion(self):
    "\n            \n        "
    tree_string = StringIO.StringIO()
    self.pdf.tree.write(tree_string, pretty_print=True, encoding='utf-8')
    tree_string = tree_string.getvalue()
    comparison_file = ('tests/saved_output/IRS_1040A_output%s.xml' % ('_python_2.6' if ((sys.version_info[0] == 2) and (sys.version_info[1] < 7)) else ))
    with open(comparison_file, 'rb') as f:
        saved_string = f.read()
    if (tree_string != saved_string):
        with open('tests/failed_output.xml', 'wb') as out:
            out.write(tree_string)
        self.fail(('XML conversion of sample pdf has changed! Compare %s to tests/failed_output.xml.' % comparison_file))