[PATCH 10 of 16 eac] [py3] Feed Binary with a bytes value

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


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1569920958 -7200
#      Tue Oct 01 11:09:18 2019 +0200
# Node ID 6ed322b62fcb9e498ab5763b0fbf40ea75d609e9
# Parent  1b87b40790f6558e399d1d6f6c89186a622a2df2
# Available At http://hg.logilab.org/review/cubes/eac
#              hg pull http://hg.logilab.org/review/cubes/eac -r 6ed322b62fcb
[py3] Feed Binary with a bytes value

diff --git a/test/export-simple.rst b/test/export-simple.rst
index bf0233b..8e6eec0 100644
--- a/test/export-simple.rst
+++ b/test/export-simple.rst
@@ -21,14 +21,14 @@ A simple export test case
     >>> resource_relation = cnx.create_entity(
     ...     'EACResourceRelation', resource_relation_resource=uri,
     ...     resource_relation_agent=record,
-    ...     xml_wrap=Binary('<pif><paf>pouf</paf></pif>'))
+    ...     xml_wrap=Binary(b'<pif><paf>pouf</paf></pif>'))
     >>> record2 = testutils.authority_record(
     ...     cnx, u'does not matter', kind=u'authority',
     ...     cwuri=u'http://www.example.org/record2')
     >>> chronological_relation = cnx.create_entity(
     ...     'ChronologicalRelation', entry=u'Super Service',
     ...     chronological_predecessor=record2, chronological_successor=record,
-    ...     xml_wrap=Binary('<plip>plop</plip>'))
+    ...     xml_wrap=Binary(b'<plip>plop</plip>'))
     >>> cnx.commit()
     >>> print record.cw_adapt_to('EAC-CPF').dump()
     <?xml version='1.0' encoding='utf-8'?>
diff --git a/test/test_views.py b/test/test_views.py
index 3ca90c3..f421a84 100644
--- a/test/test_views.py
+++ b/test/test_views.py
@@ -106,7 +106,7 @@ class FuncViewsTC(CubicWebTC):
             cnx.create_entity('EACResourceRelation',
                               resource_relation_agent=bob,
                               resource_relation_resource=uri,
-                              xml_wrap=Binary('<plip>plop</plip>'))
+                              xml_wrap=Binary(b'<plip>plop</plip>'))
             cnx.commit()
         with self.admin_access.web_request() as req:
             rset = req.find('EACResourceRelation')



More information about the saem-devel mailing list