Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
996b8717
Commit
996b8717
authored
Jul 31, 2023
by
Emmy Vouriot
Committed by
Jérome Perrin
Mar 06, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
str to bytes WIP
parent
a1744f6e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
product/ERP5OOo/tests/testIngestion.py
product/ERP5OOo/tests/testIngestion.py
+13
-9
No files found.
product/ERP5OOo/tests/testIngestion.py
View file @
996b8717
...
...
@@ -1533,6 +1533,7 @@ class TestIngestion(IngestionTestCase):
"""
input_script_id
=
'Document_getPropertyDictFromContent'
python_code
=
"""from Products.CMFCore.utils import getToolByName
import six
portal = context.getPortalObject()
information = context.getContentInformation()
...
...
@@ -1541,7 +1542,7 @@ property_id_list = context.propertyIds()
for k, v in information.items():
key = k.lower()
if v:
if isinstance(v, unicode):
if
six.PY2 and
isinstance(v, unicode):
v = v.encode('utf-8')
if key in property_id_list:
if key == 'reference':
...
...
@@ -1588,7 +1589,7 @@ return result
document_to_ingest2
=
self
.
portal
.
portal_contributions
.
newContent
(
portal_type
=
'File'
,
filename
=
'toto.txt'
,
data
=
'Hello World!'
)
data
=
b
'Hello World!'
)
document_to_ingest2
.
publish
()
self
.
tic
()
url2
=
document_to_ingest2
.
absolute_url
()
+
'/getData'
...
...
@@ -1614,6 +1615,7 @@ return result
"""
input_script_id
=
'Document_getPropertyDictFromContent'
python_code
=
"""from Products.CMFCore.utils import getToolByName
import six
portal = context.getPortalObject()
information = context.getContentInformation()
...
...
@@ -1622,7 +1624,7 @@ property_id_list = context.propertyIds()
for k, v in information.items():
key = k.lower()
if v:
if isinstance(v, unicode):
if
six.PY2 and
isinstance(v, unicode):
v = v.encode('utf-8')
if key in property_id_list:
if key == 'reference':
...
...
@@ -1666,7 +1668,7 @@ return result
document_to_ingest2
=
self
.
portal
.
portal_contributions
.
newContent
(
portal_type
=
'File'
,
filename
=
'toto.txt'
,
data
=
'Hello World!'
)
data
=
b
'Hello World!'
)
document_to_ingest2
.
publish
()
self
.
tic
()
url2
=
document_to_ingest2
.
absolute_url
()
+
'/getData'
...
...
@@ -1724,7 +1726,7 @@ context.setReference(reference)
document_to_ingest2
=
self
.
portal
.
portal_contributions
.
newContent
(
portal_type
=
'File'
,
filename
=
'toto.txt'
,
data
=
'Hello World!'
)
data
=
b
'Hello World!'
)
document_to_ingest2
.
publish
()
self
.
tic
()
self
.
assertEqual
(
document_to_ingest2
.
getReference
(),
...
...
@@ -1754,6 +1756,7 @@ context.setReference(reference)
"""
input_script_id
=
'Document_getPropertyDictFromContent'
python_code
=
"""from Products.CMFCore.utils import getToolByName
import six
portal = context.getPortalObject()
information = context.getContentInformation()
...
...
@@ -1762,7 +1765,7 @@ property_id_list = context.propertyIds()
for k, v in information.items():
key = k.lower()
if v:
if isinstance(v, unicode):
if
six.PY2 and
isinstance(v, unicode):
v = v.encode('utf-8')
if key in property_id_list:
if key == 'reference':
...
...
@@ -1815,7 +1818,7 @@ return result
document_to_ingest2
=
self
.
portal
.
portal_contributions
.
newContent
(
portal_type
=
'File'
,
filename
=
'toto.txt'
,
data
=
'Hello World!'
)
data
=
b
'Hello World!'
)
document_to_ingest2
.
publish
()
self
.
tic
()
self
.
assertEqual
(
document_to_ingest2
.
getReference
(),
...
...
@@ -1845,6 +1848,7 @@ return result
"""
input_script_id
=
'Document_getPropertyDictFromContent'
python_code
=
"""from Products.CMFCore.utils import getToolByName
import six
portal = context.getPortalObject()
information = context.getContentInformation()
...
...
@@ -1853,7 +1857,7 @@ property_id_list = context.propertyIds()
for k, v in information.items():
key = k.lower()
if v:
if isinstance(v, unicode):
if
six.PY2 and
isinstance(v, unicode):
v = v.encode('utf-8')
if key in property_id_list:
if key == 'reference':
...
...
@@ -1905,7 +1909,7 @@ return result
document_to_ingest2
=
self
.
portal
.
portal_contributions
.
newContent
(
portal_type
=
'File'
,
filename
=
'toto.txt'
,
data
=
'Hello World!'
)
data
=
b
'Hello World!'
)
document_to_ingest2
.
publish
()
self
.
tic
()
self
.
assertEqual
(
document_to_ingest2
.
getReference
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment