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
144
Merge Requests
144
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
060f2c81
Commit
060f2c81
authored
Mar 16, 2023
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testOrder: py3 fixes
parent
94098d6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testOrder.py
...TestTemplateItem/portal_components/test.erp5.testOrder.py
+6
-5
No files found.
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testOrder.py
View file @
060f2c81
...
...
@@ -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
.
assert
True
(
isinstance
(
client
.
getDefaultImageValue
().
data
,
Pdata
)
)
self
.
assert
IsInstance
(
client
.
getDefaultImageValue
().
data
,
Pdata
)
vendor
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
,
title
=
'Vendor'
,
default_image_file
=
image
)
self
.
assert
True
(
isinstance
(
vendor
.
getDefaultImageValue
().
data
,
Pdata
)
)
self
.
assert
IsInstance
(
vendor
.
getDefaultImageValue
().
data
,
Pdata
)
order
=
self
.
portal
.
getDefaultModule
(
self
.
order_portal_type
).
newContent
(
portal_type
=
self
.
order_portal_type
,
specialise
=
self
.
business_process
,
...
...
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