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
139
Merge Requests
139
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
54cec8fa
Commit
54cec8fa
authored
Mar 16, 2023
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testOrder: py3 fixes
parent
e5d59793
Changes
1
Show 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 @
54cec8fa
...
@@ -28,8 +28,9 @@
...
@@ -28,8 +28,9 @@
#
#
##############################################################################
##############################################################################
import
unittest
import
functools
import
os
import
os
import
unittest
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
FileUpload
,
\
from
Products.ERP5Type.tests.utils
import
FileUpload
,
\
...
@@ -464,7 +465,7 @@ class TestOrderMixin(SubcontentReindexingWrapper):
...
@@ -464,7 +465,7 @@ class TestOrderMixin(SubcontentReindexingWrapper):
"""
"""
Split a list and return tuple with the 2 half
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
:]
)
return
(
l
[:
middle
]
,
l
[
middle
:]
)
def
stepSetOrderLineHalfVCL
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
def
stepSetOrderLineHalfVCL
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
...
@@ -516,7 +517,7 @@ class TestOrderMixin(SubcontentReindexingWrapper):
...
@@ -516,7 +517,7 @@ class TestOrderMixin(SubcontentReindexingWrapper):
self
.
assertEqual
(
len
(
cell_key_list
),
0
)
self
.
assertEqual
(
len
(
cell_key_list
),
0
)
else
:
else
:
len_range
=
[
len
(
x
)
for
x
in
cell_range
]
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
,
\
def
stepCompleteOrderLineMatrix
(
self
,
sequence
=
None
,
sequence_list
=
None
,
\
**
kw
):
**
kw
):
...
@@ -2838,11 +2839,11 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
...
@@ -2838,11 +2839,11 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
portal_type
=
'Organisation'
,
title
=
'Client'
,
portal_type
=
'Organisation'
,
title
=
'Client'
,
default_image_file
=
image
)
default_image_file
=
image
)
from
OFS.Image
import
Pdata
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
(
vendor
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
,
title
=
'Vendor'
,
portal_type
=
'Organisation'
,
title
=
'Vendor'
,
default_image_file
=
image
)
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
(
order
=
self
.
portal
.
getDefaultModule
(
self
.
order_portal_type
).
newContent
(
portal_type
=
self
.
order_portal_type
,
portal_type
=
self
.
order_portal_type
,
specialise
=
self
.
business_process
,
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