Commit e0681848 authored by Jérome Perrin's avatar Jérome Perrin

open_api: py3

parent e4767f2f
...@@ -340,7 +340,10 @@ class OpenAPITypeInformation(ERP5TypeInformation): ...@@ -340,7 +340,10 @@ class OpenAPITypeInformation(ERP5TypeInformation):
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
def getSchema(self): 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': if self.getContentType() == 'application/x-yaml':
try: try:
import yaml # pylint:disable=import-error import yaml # pylint:disable=import-error
......
...@@ -980,7 +980,7 @@ class TestOpenAPIErrorHandling(OpenAPIPetStoreTestCase): ...@@ -980,7 +980,7 @@ class TestOpenAPIErrorHandling(OpenAPIPetStoreTestCase):
self.addPythonScript( self.addPythonScript(
'TestPetStoreOpenAPI_findPetsByStatus', 'TestPetStoreOpenAPI_findPetsByStatus',
'status', 'status',
'1/0', '1//0',
) )
response = self.publish( response = self.publish(
self.connector.getPath() + '/pet/findByStatus?status=available') 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