Commit 4b343a2a authored by Jérome Perrin's avatar Jérome Perrin

open_api: py3

parent 088e6855
......@@ -340,7 +340,10 @@ class OpenAPITypeInformation(ERP5TypeInformation):
security.declareObjectProtected(Permissions.AccessContentsInformation)
def getSchema(self):
stream = io.BytesIO(self.getTextContent() or b'{}')
text_content = self.getTextContent() or '{}'
if six.PY3:
text_content = text_content.encode()
stream = io.BytesIO(text_content)
if self.getContentType() == 'application/x-yaml':
try:
import yaml # pylint:disable=import-error
......
......@@ -980,7 +980,7 @@ class TestOpenAPIErrorHandling(OpenAPIPetStoreTestCase):
self.addPythonScript(
'TestPetStoreOpenAPI_findPetsByStatus',
'status',
'1/0',
'1//0',
)
response = self.publish(
self.connector.getPath() + '/pet/findByStatus?status=available')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment