[PATCH 07 of 16 eac] [py3] Use bytes value for xml_wrap field

Denis Laxalde denis.laxalde at logilab.fr
Tue Oct 1 12:36:33 CEST 2019


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1569919888 -7200
#      Tue Oct 01 10:51:28 2019 +0200
# Node ID d98e4759b2c707b4ad9efe00816929f3b15fe577
# Parent  2fc2e95e0e78f174ade198802cfac042e1a350ba
# Available At http://hg.logilab.org/review/cubes/eac
#              hg pull http://hg.logilab.org/review/cubes/eac -r d98e4759b2c7
[py3] Use bytes value for xml_wrap field

diff --git a/test/test_dataimport.py b/test/test_dataimport.py
index adbdec6..ff1673b 100644
--- a/test/test_dataimport.py
+++ b/test/test_dataimport.py
@@ -306,7 +306,7 @@ class EACXMLParserTC(unittest.TestCase):
              {'chronological_predecessor': set(['FRAD033_EAC_00001']),
               'chronological_successor': set(['/dev/null']),
               'start_date': set([datetime.date(2042, 1, 1)]),
-              'xml_wrap': set(['<gloups xmlns="urn:isbn:1-931666-33-4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">hips</gloups>']),  # noqa
+              'xml_wrap': set([b'<gloups xmlns="urn:isbn:1-931666-33-4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">hips</gloups>']),  # noqa
               'entry': set([u'Trash']),
              },
             ),
@@ -323,7 +323,7 @@ class EACXMLParserTC(unittest.TestCase):
               'resource_relation_agent': set(['FRAD033_EAC_00001']),
               'start_date': set([datetime.date(1673, 1, 1)]),
               'end_date': set([datetime.date(1963, 1, 1)]),
-              'xml_wrap': set(['<he xmlns="urn:isbn:1-931666-33-4" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">joe</he>']),  # noqa
+              'xml_wrap': set([b'<he xmlns="urn:isbn:1-931666-33-4" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">joe</he>']),  # noqa
              },
             ),
             ('ExternalUri', 'http://gael.gironde.fr/ead.html?id=FRAD033_IR_N',
@@ -564,7 +564,7 @@ class EACDataImportTC(CubicWebTC):
         self.assertEqual(exturi.uri,
                          u'http://gael.gironde.fr/ead.html?id=FRAD033_IR_N')
         self.assertEqual(rrelation.xml_wrap.getvalue(),
-                         '<he xmlns="urn:isbn:1-931666-33-4" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">joe</he>')  # noqa
+                         b'<he xmlns="urn:isbn:1-931666-33-4" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">joe</he>')  # noqa
 
     def _check_equivalent_concept(self, cnx, record):
         functions = dict((f.name, f) for f in record.reverse_function_agent)



More information about the saem-devel mailing list