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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Leo Le Bouter
erp5
Commits
07dedbdd
Commit
07dedbdd
authored
Sep 02, 2020
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZODB Components: erp5_trade: Migrate Unit Tests.
parent
c7c2ad83
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
349 additions
and
21 deletions
+349
-21
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testAmount.py
...estTemplateItem/portal_components/test.erp5.testAmount.py
+1
-1
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testAmount.xml
...stTemplateItem/portal_components/test.erp5.testAmount.xml
+110
-0
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testResource.py
...tTemplateItem/portal_components/test.erp5.testResource.py
+15
-19
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testResource.xml
...TemplateItem/portal_components/test.erp5.testResource.xml
+110
-0
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testSupply.py
...estTemplateItem/portal_components/test.erp5.testSupply.py
+0
-1
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testSupply.xml
...stTemplateItem/portal_components/test.erp5.testSupply.xml
+110
-0
bt5/erp5_trade/bt/template_test_id_list
bt5/erp5_trade/bt/template_test_id_list
+3
-0
No files found.
product/ERP5/tests/
testAmount.py
→
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.
testAmount.py
View file @
07dedbdd
...
...
@@ -79,7 +79,7 @@ class TestAmount(ERP5TypeTestCase):
"""
return
1
def
afterSetUp
(
self
,
quiet
=
1
,
run
=
run_all_test
):
def
afterSetUp
(
self
,
*
args
,
**
kw
):
self
.
login
()
def
stepCreateResource
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
...
...
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testAmount.xml
0 → 100644
View file @
07dedbdd
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testAmount
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.tests.testAmount
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testAmount
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/tests/
testResource.py
→
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.
testResource.py
View file @
07dedbdd
...
...
@@ -70,7 +70,7 @@ class TestResource(ERP5TypeTestCase):
def
getTitle
(
self
):
return
"Resource"
def
login
(
self
):
def
login
(
self
,
*
args
,
**
kw
):
uf
=
self
.
getPortal
().
acl_users
uf
.
_doAddUser
(
'rc'
,
''
,
[
'Manager'
],
[])
user
=
uf
.
getUserById
(
'rc'
).
__of__
(
uf
)
...
...
@@ -122,28 +122,25 @@ class TestResource(ERP5TypeTestCase):
size_category_list
=
[
'Baby'
,
'Child'
,
'Man'
,
'Woman'
]
if
len
(
self
.
category_tool
.
size
.
contentValues
())
==
0
:
for
category_id
in
size_category_list
:
o
=
self
.
category_tool
.
size
.
newContent
(
portal_type
=
'Category'
,
self
.
category_tool
.
size
.
newContent
(
portal_type
=
'Category'
,
id
=
category_id
)
self
.
size_category_list
=
map
(
lambda
x
:
'size/%s'
%
x
,
size_category_list
)
self
.
size_category_list
=
[
'size/%s'
%
x
for
x
in
size_category_list
]
colour_category_list
=
[
'blue'
,
'green'
]
if
len
(
self
.
category_tool
.
colour
.
contentValues
())
==
0
:
for
category_id
in
colour_category_list
:
o
=
self
.
category_tool
.
colour
.
newContent
(
portal_type
=
'Category'
,
id
=
category_id
)
self
.
colour_category_list
=
map
(
lambda
x
:
'colour/%s'
%
x
,
colour_category_list
)
self
.
category_tool
.
colour
.
newContent
(
portal_type
=
'Category'
,
id
=
category_id
)
self
.
colour_category_list
=
[
'colour/%s'
%
x
for
x
in
colour_category_list
]
ind_phase_category_list
=
[
'phase1'
,
'phase2'
]
if
len
(
self
.
category_tool
.
industrial_phase
.
contentValues
())
==
0
:
for
category_id
in
ind_phase_category_list
:
o
=
self
.
category_tool
.
industrial_phase
.
newContent
(
self
.
category_tool
.
industrial_phase
.
newContent
(
portal_type
=
'Category'
,
id
=
category_id
)
self
.
industrial_phase_category_list
=
map
(
lambda
x
:
'industrial_phase/%s'
%
x
,
ind_phase_category_list
)
self
.
industrial_phase_category_list
=
[
'industrial_phase/%s'
%
x
for
x
in
ind_phase_category_list
]
self
.
morphology_category_list
=
[]
self
.
base_category_content_list
=
{
...
...
@@ -251,7 +248,7 @@ class TestResource(ERP5TypeTestCase):
Set category variation to current resource
"""
resource
=
sequence
.
get
(
'resource'
)
size_list
=
map
(
lambda
x
:
x
[
len
(
'size/'
):],
self
.
size_list
)
size_list
=
[
x
[
len
(
'size/'
):]
for
x
in
self
.
size_list
]
resource
.
setSizeList
(
size_list
)
self
.
category_list
=
self
.
size_list
[:]
...
...
@@ -373,7 +370,7 @@ class TestResource(ERP5TypeTestCase):
resource
=
sequence
.
get
(
'resource'
)
vrcl
=
resource
.
getVariationRangeCategoryList
()
vrcil
=
resource
.
getVariationRangeCategoryItemList
()
self
.
failIfDifferentSet
(
vrcl
,
map
(
lambda
x
:
x
[
1
],
vrcil
)
)
self
.
failIfDifferentSet
(
vrcl
,
[
x
[
1
]
for
x
in
vrcil
]
)
def
test_03_getVariationRangeCategoryItemList
(
self
,
quiet
=
quiet
,
run
=
run_all_test
):
...
...
@@ -434,7 +431,7 @@ class TestResource(ERP5TypeTestCase):
resource
=
sequence
.
get
(
'resource'
)
vcl
=
resource
.
getVariationCategoryList
()
vcil
=
resource
.
getVariationCategoryItemList
()
self
.
failIfDifferentSet
(
vcl
,
map
(
lambda
x
:
x
[
1
],
vcil
)
)
self
.
failIfDifferentSet
(
vcl
,
[
x
[
1
]
for
x
in
vcil
]
)
def
test_06_getVariationCategoryItemList
(
self
,
quiet
=
quiet
,
run
=
run_all_test
):
"""
...
...
@@ -452,7 +449,7 @@ class TestResource(ERP5TypeTestCase):
resource
=
sequence
.
get
(
'resource'
)
vcl
=
resource
.
getVariationCategoryList
(
omit_individual_variation
=
0
)
vcil
=
resource
.
getVariationCategoryItemList
(
omit_individual_variation
=
0
)
self
.
failIfDifferentSet
(
vcl
,
map
(
lambda
x
:
x
[
1
],
vcil
)
)
self
.
failIfDifferentSet
(
vcl
,
[
x
[
1
]
for
x
in
vcil
]
)
def
test_07_getVariationCategoryItemList
(
self
,
quiet
=
quiet
,
run
=
run_all_test
):
"""
...
...
@@ -581,7 +578,7 @@ class TestResource(ERP5TypeTestCase):
]
return
config
def
logMessage
(
self
,
msg
,
tab
=
0
):
def
logMessage
(
self
,
msg
,
tab
=
0
):
# pylint: disable=arguments-differ
"""
Log a message.
"""
...
...
@@ -611,7 +608,7 @@ class TestResource(ERP5TypeTestCase):
for
key
,
value
in
config
.
items
():
if
key
!=
'price'
:
if
value
not
in
[
None
,
[]]:
if
type
(
value
)
!=
type
([]
):
if
not
isinstance
(
value
,
list
):
value_list
=
[
value
]
else
:
value_list
=
value
...
...
@@ -918,7 +915,6 @@ class TestResource(ERP5TypeTestCase):
# Initialize variables
product_module
=
self
.
portal
.
getDefaultModule
(
self
.
product_portal_type
)
organisation_module
=
self
.
getOrganisationModule
()
currency_module
=
self
.
getCurrencyModule
()
sale_order_module
=
self
.
portal
.
getDefaultModule
(
"Sale Order"
)
purchase_order_module
=
self
.
portal
.
getDefaultModule
(
"Purchase Order"
)
internal_packing_list_module
=
self
.
portal
.
getDefaultModule
(
"Internal Packing List"
)
...
...
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testResource.xml
0 → 100644
View file @
07dedbdd
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testResource
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.tests.testResource
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testResource
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/tests/
testSupply.py
→
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.
testSupply.py
View file @
07dedbdd
...
...
@@ -33,7 +33,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
reindex
from
Products.ERP5Type.tests.utils
import
SubcontentReindexingWrapper
from
DateTime
import
DateTime
import
transaction
class
TestSupplyMixin
:
def
getBusinessTemplateList
(
self
):
...
...
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testSupply.xml
0 → 100644
View file @
07dedbdd
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testSupply
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.tests.testSupply
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testSupply
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_trade/bt/template_test_id_list
View file @
07dedbdd
test.erp5.testAmount
test.erp5.testDeliveryNode
test.erp5.testDivergenceTester
test.erp5.testERP5Simulation
...
...
@@ -10,6 +11,8 @@ test.erp5.testOrderBuilder
test.erp5.testPackingList
test.erp5.testPackingListRoundingPrecision
test.erp5.testPurchaseOrder
test.erp5.testResource
test.erp5.testReturnedOrder
test.erp5.testReturnedSalePackingList
test.erp5.testSupply
test.erp5.testTradeReports
\ No newline at end of file
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