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

testOrder: py3 fixes

parent 6305334a
......@@ -28,8 +28,9 @@
#
##############################################################################
import unittest
import functools
import os
import unittest
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import FileUpload,\
......@@ -464,7 +465,7 @@ class TestOrderMixin(SubcontentReindexingWrapper):
"""
Split a list and return tuple with the 2 half
"""
middle = len(l)/2 + len(l)%2
middle = int(len(l)//2 + len(l)%2)
return ( l[:middle] , l[middle:] )
def stepSetOrderLineHalfVCL(self,sequence=None, sequence_list=None, **kw):
......@@ -516,7 +517,7 @@ class TestOrderMixin(SubcontentReindexingWrapper):
self.assertEqual(len(cell_key_list), 0)
else:
len_range = [len(x) for x in cell_range]
self.assertEqual(len(cell_key_list), reduce(lambda x,y: x*y, len_range))
self.assertEqual(len(cell_key_list), functools.reduce(lambda x,y: x*y, len_range))
def stepCompleteOrderLineMatrix(self,sequence=None, sequence_list=None, \
**kw):
......@@ -2838,11 +2839,11 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
portal_type='Organisation', title='Client',
default_image_file=image)
from OFS.Image import Pdata
self.assertTrue(isinstance(client.getDefaultImageValue().data, Pdata))
self.assertIsInstance(client.getDefaultImageValue().data, Pdata)
vendor = self.portal.organisation_module.newContent(
portal_type='Organisation', title='Vendor',
default_image_file=image)
self.assertTrue(isinstance(vendor.getDefaultImageValue().data, Pdata))
self.assertIsInstance(vendor.getDefaultImageValue().data, Pdata)
order = self.portal.getDefaultModule(self.order_portal_type).newContent(
portal_type=self.order_portal_type,
specialise=self.business_process,
......
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