Commit 2d417d32 authored by Jérome Perrin's avatar Jérome Perrin

safeimage: py3

parent 82822bfb
...@@ -43,7 +43,7 @@ class TestSafeImage(ERP5TypeTestCase): ...@@ -43,7 +43,7 @@ class TestSafeImage(ERP5TypeTestCase):
image = portal.restrictedTraverse('portal_skins/erp5_safeimage/img/image_unit_test.jpg') image = portal.restrictedTraverse('portal_skins/erp5_safeimage/img/image_unit_test.jpg')
path_image = "image_unit_test.jpg" path_image = "image_unit_test.jpg"
fd = os.open(path_image, os.O_CREAT | os.O_RDWR) fd = os.open(path_image, os.O_CREAT | os.O_RDWR)
os.write(fd,str(image.data)) os.write(fd, bytes(image.data))
os.close(fd) os.close(fd)
_image = makeFileUpload(path_image) _image = makeFileUpload(path_image)
image = self.image_module.newContent(portal_type='Image',title='testImage', image = self.image_module.newContent(portal_type='Image',title='testImage',
...@@ -55,7 +55,7 @@ class TestSafeImage(ERP5TypeTestCase): ...@@ -55,7 +55,7 @@ class TestSafeImage(ERP5TypeTestCase):
image = portal.restrictedTraverse('portal_skins/erp5_safeimage/img/image_unit_test.jpg') image = portal.restrictedTraverse('portal_skins/erp5_safeimage/img/image_unit_test.jpg')
path_image = "image_unit_test.jpg" path_image = "image_unit_test.jpg"
fd = os.open(path_image, os.O_CREAT | os.O_RDWR) fd = os.open(path_image, os.O_CREAT | os.O_RDWR)
os.write(fd,str(image.data)) os.write(fd, bytes(image.data))
os.close(fd) os.close(fd)
tile_image = makeFileUpload(path_image) tile_image = makeFileUpload(path_image)
tile = self.image_module.newContent(portal_type='Image Tile',title='testTile', tile = self.image_module.newContent(portal_type='Image Tile',title='testTile',
...@@ -67,7 +67,7 @@ class TestSafeImage(ERP5TypeTestCase): ...@@ -67,7 +67,7 @@ class TestSafeImage(ERP5TypeTestCase):
image = portal.restrictedTraverse('portal_skins/erp5_safeimage/img/image_unit_test.jpg') image = portal.restrictedTraverse('portal_skins/erp5_safeimage/img/image_unit_test.jpg')
path_image = "image_unit_test.jpg" path_image = "image_unit_test.jpg"
fd = os.open(path_image, os.O_CREAT | os.O_RDWR) fd = os.open(path_image, os.O_CREAT | os.O_RDWR)
os.write(fd,str(image.data)) os.write(fd, bytes(image.data))
os.close(fd) os.close(fd)
tile_image_transformed = makeFileUpload(path_image) tile_image_transformed = makeFileUpload(path_image)
tile_transformed = self.image_module.newContent(portal_type='Image Tile Transformed', tile_transformed = self.image_module.newContent(portal_type='Image Tile Transformed',
......
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