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
Thomas Gambier
erp5
Commits
f4cbf48d
Commit
f4cbf48d
authored
Sep 02, 2020
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZODB Components: erp5_simplified_invoicing: Migrate Unit Tests.
parent
7168f05d
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
699 additions
and
37 deletions
+699
-37
bt5/erp5_mrp/TestTemplateItem/portal_components/test.erp5.testMRP.py
...p/TestTemplateItem/portal_components/test.erp5.testMRP.py
+1
-1
bt5/erp5_payroll/TestTemplateItem/portal_components/test.erp5.testPayroll.py
...stTemplateItem/portal_components/test.erp5.testPayroll.py
+1
-1
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testBPMCore.py
...stTemplateItem/portal_components/test.erp5.testBPMCore.py
+4
-3
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testBPMCore.xml
...tTemplateItem/portal_components/test.erp5.testBPMCore.xml
+110
-0
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testComplexTradeModelLineUseCase.py
..._components/test.erp5.testComplexTradeModelLineUseCase.py
+1
-1
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testComplexTradeModelLineUseCase.xml
...components/test.erp5.testComplexTradeModelLineUseCase.xml
+110
-0
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testSimulationPerformance.py
.../portal_components/test.erp5.testSimulationPerformance.py
+1
-1
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testSimulationPerformance.xml
...portal_components/test.erp5.testSimulationPerformance.xml
+104
-0
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testTradeCondition.py
...ateItem/portal_components/test.erp5.testTradeCondition.py
+11
-11
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testTradeCondition.xml
...teItem/portal_components/test.erp5.testTradeCondition.xml
+110
-0
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testTradeModelLine.py
...ateItem/portal_components/test.erp5.testTradeModelLine.py
+15
-15
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testTradeModelLine.xml
...teItem/portal_components/test.erp5.testTradeModelLine.xml
+110
-0
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testTradeModelLinePurchase.py
...portal_components/test.erp5.testTradeModelLinePurchase.py
+1
-1
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testTradeModelLinePurchase.xml
...ortal_components/test.erp5.testTradeModelLinePurchase.xml
+110
-0
bt5/erp5_simplified_invoicing/bt/template_test_id_list
bt5/erp5_simplified_invoicing/bt/template_test_id_list
+7
-1
bt5/erp5_simplified_invoicing/bt/test_dependency_list
bt5/erp5_simplified_invoicing/bt/test_dependency_list
+3
-2
No files found.
bt5/erp5_mrp/TestTemplateItem/portal_components/test.erp5.testMRP.py
View file @
f4cbf48d
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
import
unittest
import
unittest
from
DateTime
import
DateTime
from
DateTime
import
DateTime
from
Products.ERP5.tests
.testBPMCore
import
TestBPMMixin
from
erp5.component.test
.testBPMCore
import
TestBPMMixin
class
TestMRPMixin
(
TestBPMMixin
):
class
TestMRPMixin
(
TestBPMMixin
):
...
...
bt5/erp5_payroll/TestTemplateItem/portal_components/test.erp5.testPayroll.py
View file @
f4cbf48d
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
#
#
##############################################################################
##############################################################################
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5ReportTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5ReportTestCase
from
Products.ERP5.tests
.testTradeModelLine
import
TestTradeModelLineMixin
from
erp5.component.test
.testTradeModelLine
import
TestTradeModelLineMixin
from
AccessControl.SecurityManagement
import
newSecurityManager
from
AccessControl.SecurityManagement
import
newSecurityManager
from
Products.ERP5Type.tests.Sequence
import
SequenceList
from
Products.ERP5Type.tests.Sequence
import
SequenceList
from
Products.ERP5Type.tests.utils
import
reindex
from
Products.ERP5Type.tests.utils
import
reindex
...
...
product/ERP5/tests/
testBPMCore.py
→
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.
testBPMCore.py
View file @
f4cbf48d
...
@@ -166,7 +166,7 @@ class TestBPMMixin(ERP5TypeTestCase):
...
@@ -166,7 +166,7 @@ class TestBPMMixin(ERP5TypeTestCase):
return
business_link
return
business_link
def
createTradeModelPath
(
self
,
business_process
=
None
,
def
createTradeModelPath
(
self
,
business_process
=
None
,
criterion_property_dict
=
{}
,
**
kw
):
criterion_property_dict
=
None
,
**
kw
):
if
business_process
is
None
:
if
business_process
is
None
:
business_process
=
self
.
createBusinessProcess
()
business_process
=
self
.
createBusinessProcess
()
if
kw
.
get
(
'reference'
)
and
not
kw
.
get
(
'id'
):
if
kw
.
get
(
'reference'
)
and
not
kw
.
get
(
'id'
):
...
@@ -175,8 +175,8 @@ class TestBPMMixin(ERP5TypeTestCase):
...
@@ -175,8 +175,8 @@ class TestBPMMixin(ERP5TypeTestCase):
portal_type
=
self
.
trade_model_path_portal_type
,
**
kw
)
portal_type
=
self
.
trade_model_path_portal_type
,
**
kw
)
if
criterion_property_dict
:
if
criterion_property_dict
:
trade_model_path
.
_setCriterionPropertyList
(
tuple
(
criterion_property_dict
))
trade_model_path
.
_setCriterionPropertyList
(
tuple
(
criterion_property_dict
))
for
property
,
identity
in
criterion_property_dict
.
iteritems
():
for
property
_
,
identity
in
criterion_property_dict
.
iteritems
():
trade_model_path
.
setCriterion
(
property
,
identity
)
trade_model_path
.
setCriterion
(
property
_
,
identity
)
reference
=
kw
.
get
(
'reference'
,
None
)
reference
=
kw
.
get
(
'reference'
,
None
)
if
reference
is
not
None
:
if
reference
is
not
None
:
setattr
(
self
,
reference
,
trade_model_path
)
setattr
(
self
,
reference
,
trade_model_path
)
...
@@ -605,6 +605,7 @@ class TestBPMImplementation(TestBPMDummyDeliveryMovementMixin):
...
@@ -605,6 +605,7 @@ class TestBPMImplementation(TestBPMDummyDeliveryMovementMixin):
checkExpectedDates
(
self
.
delivery_simulation_movement
.
getParentValue
(),
checkExpectedDates
(
self
.
delivery_simulation_movement
.
getParentValue
(),
base_date
,
base_date
+
2
)
base_date
,
base_date
+
2
)
# pylint: disable=anomalous-backslash-in-string
"""
"""
XXX More complex scenarios must be tested, like when several path are
XXX More complex scenarios must be tested, like when several path are
possible like this :
possible like this :
...
...
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testBPMCore.xml
0 → 100644
View file @
f4cbf48d
<?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>
testBPMCore
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.tests.testBPMCore
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testBPMCore
</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/
testComplexTradeModelLineUseCase.py
→
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.
testComplexTradeModelLineUseCase.py
View file @
f4cbf48d
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
##############################################################################
##############################################################################
import
unittest
import
unittest
from
Products.ERP5.tests
.testTradeModelLine
import
TestTradeModelLineMixin
from
erp5.component.test
.testTradeModelLine
import
TestTradeModelLineMixin
class
TestComplexTradeModelLineUseCase
(
TestTradeModelLineMixin
):
class
TestComplexTradeModelLineUseCase
(
TestTradeModelLineMixin
):
...
...
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testComplexTradeModelLineUseCase.xml
0 → 100644
View file @
f4cbf48d
<?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>
testComplexTradeModelLineUseCase
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.tests.testComplexTradeModelLineUseCase
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testComplexTradeModelLineUseCase
</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/
testSimulationPerformance.py
→
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.
testSimulationPerformance.py
View file @
f4cbf48d
...
@@ -31,7 +31,7 @@ from test import pystone
...
@@ -31,7 +31,7 @@ from test import pystone
from
time
import
time
from
time
import
time
pystone
.
clock
=
time
pystone
.
clock
=
time
from
Products.ERP5Type.tests.runUnitTest
import
ERP5TypeTestLoader
from
Products.ERP5Type.tests.runUnitTest
import
ERP5TypeTestLoader
from
Products.ERP5.tests
.testTradeModelLine
import
TestTradeModelLineSale
from
erp5.component.test
.testTradeModelLine
import
TestTradeModelLineSale
if
ERP5TypeTestLoader
.
_testMethodPrefix
==
'test'
:
if
ERP5TypeTestLoader
.
_testMethodPrefix
==
'test'
:
ERP5TypeTestLoader
.
_testMethodPrefix
=
'perf'
ERP5TypeTestLoader
.
_testMethodPrefix
=
'perf'
...
...
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testSimulationPerformance.xml
0 → 100644
View file @
f4cbf48d
<?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>
testSimulationPerformance
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.tests.testSimulationPerformance
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testSimulationPerformance
</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/
testTradeCondition.py
→
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.
testTradeCondition.py
View file @
f4cbf48d
...
@@ -252,7 +252,7 @@ class TestTradeConditionSupplyLine(TradeConditionTestCase):
...
@@ -252,7 +252,7 @@ class TestTradeConditionSupplyLine(TradeConditionTestCase):
# Order ---> TC (123)
# Order ---> TC (123)
#
#
# price should be 123
# price should be 123
s
upply_line
=
s
elf
.
trade_condition
.
newContent
(
self
.
trade_condition
.
newContent
(
portal_type
=
self
.
supply_line_type
,
portal_type
=
self
.
supply_line_type
,
resource_value
=
self
.
resource
,
resource_value
=
self
.
resource
,
base_price
=
123
)
base_price
=
123
)
...
@@ -347,10 +347,10 @@ class TestTradeConditionSupplyLine(TradeConditionTestCase):
...
@@ -347,10 +347,10 @@ class TestTradeConditionSupplyLine(TradeConditionTestCase):
source_section_value
=
self
.
vendor
,
source_section_value
=
self
.
vendor
,
destination_section_value
=
self
.
client
)
destination_section_value
=
self
.
client
)
other_supply
.
validate
()
other_supply
.
validate
()
other_supply
_line
=
other_supply
.
newContent
(
other_supply
.
newContent
(
portal_type
=
self
.
supply_line_type
,
portal_type
=
self
.
supply_line_type
,
base_price
=
1
)
base_price
=
1
)
s
upply_line
=
s
elf
.
trade_condition
.
newContent
(
self
.
trade_condition
.
newContent
(
portal_type
=
self
.
supply_line_type
,
portal_type
=
self
.
supply_line_type
,
resource_value
=
self
.
resource
,
resource_value
=
self
.
resource
,
base_price
=
2
)
base_price
=
2
)
...
@@ -426,10 +426,10 @@ class TestTradeConditionSupplyLine(TradeConditionTestCase):
...
@@ -426,10 +426,10 @@ class TestTradeConditionSupplyLine(TradeConditionTestCase):
source_section_value
=
self
.
vendor
,
source_section_value
=
self
.
vendor
,
destination_section_value
=
self
.
client
)
destination_section_value
=
self
.
client
)
other_supply
.
validate
()
other_supply
.
validate
()
other_supply
_line
=
other_supply
.
newContent
(
other_supply
.
newContent
(
portal_type
=
self
.
supply_line_type
,
portal_type
=
self
.
supply_line_type
,
base_price
=
1
)
base_price
=
1
)
s
upply_line
=
s
elf
.
trade_condition
.
newContent
(
self
.
trade_condition
.
newContent
(
portal_type
=
self
.
supply_line_type
,
portal_type
=
self
.
supply_line_type
,
resource_value
=
self
.
resource
,
resource_value
=
self
.
resource
,
base_price
=
2
)
base_price
=
2
)
...
@@ -458,11 +458,11 @@ class TestTradeConditionSupplyLine(TradeConditionTestCase):
...
@@ -458,11 +458,11 @@ class TestTradeConditionSupplyLine(TradeConditionTestCase):
source_section_value
=
self
.
vendor
,
source_section_value
=
self
.
vendor
,
destination_section_value
=
self
.
client
)
destination_section_value
=
self
.
client
)
other_supply
.
validate
()
other_supply
.
validate
()
other_supply
_line
=
other_supply
.
newContent
(
other_supply
.
newContent
(
portal_type
=
self
.
supply_line_type
,
portal_type
=
self
.
supply_line_type
,
base_price
=
1
)
base_price
=
1
)
self
.
trade_condition
.
setReference
(
self
.
id
())
self
.
trade_condition
.
setReference
(
self
.
id
())
s
upply_line
=
s
elf
.
trade_condition
.
newContent
(
self
.
trade_condition
.
newContent
(
portal_type
=
self
.
supply_line_type
,
portal_type
=
self
.
supply_line_type
,
resource_value
=
self
.
resource
,
resource_value
=
self
.
resource
,
base_price
=
2
)
base_price
=
2
)
...
@@ -482,7 +482,7 @@ class TestTradeConditionSupplyLine(TradeConditionTestCase):
...
@@ -482,7 +482,7 @@ class TestTradeConditionSupplyLine(TradeConditionTestCase):
def
test_supply_line_in_other_trade_condition_does_not_apply
(
self
):
def
test_supply_line_in_other_trade_condition_does_not_apply
(
self
):
"""Supply lines from trade condition not related to an order does not apply.
"""Supply lines from trade condition not related to an order does not apply.
"""
"""
s
upply_line
=
s
elf
.
trade_condition
.
newContent
(
self
.
trade_condition
.
newContent
(
portal_type
=
self
.
supply_line_type
,
portal_type
=
self
.
supply_line_type
,
resource_value
=
self
.
resource
,
resource_value
=
self
.
resource
,
base_price
=
2
)
base_price
=
2
)
...
@@ -502,14 +502,14 @@ class TestTradeConditionSupplyLine(TradeConditionTestCase):
...
@@ -502,14 +502,14 @@ class TestTradeConditionSupplyLine(TradeConditionTestCase):
def
test_supply_line_section
(
self
):
def
test_supply_line_section
(
self
):
# if a supply lines defines a section, it has priority over supply lines
# if a supply lines defines a section, it has priority over supply lines
# not defining sections
# not defining sections
other_entity
=
self
.
portal
.
organisation_module
.
newContent
(
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
,
portal_type
=
'Organisation'
,
title
=
'Other'
)
title
=
'Other'
)
supply
=
self
.
portal
.
getDefaultModule
(
self
.
supply_type
supply
=
self
.
portal
.
getDefaultModule
(
self
.
supply_type
).
newContent
(
portal_type
=
self
.
supply_type
,
).
newContent
(
portal_type
=
self
.
supply_type
,
resource_value
=
self
.
resource
,)
resource_value
=
self
.
resource
,)
supply
.
validate
()
supply
.
validate
()
supply
_line
=
supply
.
newContent
(
supply
.
newContent
(
portal_type
=
self
.
supply_line_type
,
portal_type
=
self
.
supply_line_type
,
base_price
=
1
)
base_price
=
1
)
...
@@ -519,7 +519,7 @@ class TestTradeConditionSupplyLine(TradeConditionTestCase):
...
@@ -519,7 +519,7 @@ class TestTradeConditionSupplyLine(TradeConditionTestCase):
destination_section_value
=
self
.
client
,
destination_section_value
=
self
.
client
,
source_section_value
=
self
.
vendor
)
source_section_value
=
self
.
vendor
)
other_supply
.
validate
()
other_supply
.
validate
()
other_supply
_line
=
other_supply
.
newContent
(
other_supply
.
newContent
(
portal_type
=
self
.
supply_line_type
,
portal_type
=
self
.
supply_line_type
,
base_price
=
2
)
base_price
=
2
)
...
...
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testTradeCondition.xml
0 → 100644
View file @
f4cbf48d
<?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>
testTradeCondition
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.tests.testTradeCondition
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testTradeCondition
</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/
testTradeModelLine.py
→
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.
testTradeModelLine.py
View file @
f4cbf48d
...
@@ -33,7 +33,7 @@ import random
...
@@ -33,7 +33,7 @@ import random
import
unittest
import
unittest
from
unittest
import
expectedFailure
from
unittest
import
expectedFailure
from
Products.ERP5.tests
.testBPMCore
import
TestBPMMixin
from
erp5.component.test
.testBPMCore
import
TestBPMMixin
from
Products.ERP5Type.Base
import
Base
from
Products.ERP5Type.Base
import
Base
from
Products.ERP5Type.Utils
import
simple_decorator
from
Products.ERP5Type.Utils
import
simple_decorator
from
DateTime
import
DateTime
from
DateTime
import
DateTime
...
@@ -413,11 +413,11 @@ class TestTradeModelLine(TestTradeModelLineMixin):
...
@@ -413,11 +413,11 @@ class TestTradeModelLine(TestTradeModelLineMixin):
def
checkTradeModelRuleSimulationExpand
(
self
,
delivery
):
def
checkTradeModelRuleSimulationExpand
(
self
,
delivery
):
expected_result_dict
=
self
[
delivery
.
getPath
()]
expected_result_dict
=
self
[
delivery
.
getPath
()]
price_currency
=
self
[
'price_currency'
]
for
line
in
delivery
.
getMovementList
():
for
line
in
delivery
.
getMovementList
():
simulation_movement_list
,
=
\
simulation_movement_list_list
=
self
.
getTradeModelSimulationMovementList
(
line
)
self
.
getTradeModelSimulationMovementList
(
line
)
self
.
assertEqual
(
len
(
simulation_movement_list_list
),
1
)
simulation_movement_list
=
simulation_movement_list_list
[
0
]
result_dict
=
{
sm
.
getResourceValue
().
getUse
():
sm
result_dict
=
{
sm
.
getResourceValue
().
getUse
():
sm
for
sm
in
simulation_movement_list
}
for
sm
in
simulation_movement_list
}
self
.
assertEqual
(
len
(
simulation_movement_list
),
self
.
assertEqual
(
len
(
simulation_movement_list
),
...
@@ -1179,9 +1179,9 @@ return lambda *args, **kw: 1""")
...
@@ -1179,9 +1179,9 @@ return lambda *args, **kw: 1""")
base_contribution_list
=
'base_amount/tax'
,
bounded_fee
base_contribution_list
=
'base_amount/tax'
,
bounded_fee
kw
=
{
'portal_type'
:
self
.
order_line_portal_type
,
kw
=
{
'portal_type'
:
self
.
order_line_portal_type
,
'base_contribution_list'
:
base_contribution_list
}
'base_contribution_list'
:
base_contribution_list
}
order
_line_1
=
order
.
newContent
(
price
=
1000
,
quantity
=
1
,
order
.
newContent
(
price
=
1000
,
quantity
=
1
,
resource_value
=
resource_A
,
**
kw
)
resource_value
=
resource_A
,
**
kw
)
order
_line_2
=
order
.
newContent
(
price
=
500
,
quantity
=
1
,
order
.
newContent
(
price
=
500
,
quantity
=
1
,
resource_value
=
resource_B
,
**
kw
)
resource_value
=
resource_B
,
**
kw
)
amount_list
=
order
.
getGeneratedAmountList
()
amount_list
=
order
.
getGeneratedAmountList
()
self
.
assertEqual
([
75
],
[
x
.
getTotalPrice
()
for
x
in
amount_list
])
self
.
assertEqual
([
75
],
[
x
.
getTotalPrice
()
for
x
in
amount_list
])
...
@@ -1206,7 +1206,7 @@ return lambda *args, **kw: 1""")
...
@@ -1206,7 +1206,7 @@ return lambda *args, **kw: 1""")
base_application
=
fixed_quantity
,
base_application
=
fixed_quantity
,
price
=
1
)
price
=
1
)
# for delivery level
# for delivery level
discount
=
self
.
createTradeModelLine
(
trade_condition
,
self
.
createTradeModelLine
(
trade_condition
,
reference
=
'DISCOUNT_B'
,
reference
=
'DISCOUNT_B'
,
resource_value
=
tax
,
resource_value
=
tax
,
base_application
=
fixed_quantity
,
base_application
=
fixed_quantity
,
...
...
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testTradeModelLine.xml
0 → 100644
View file @
f4cbf48d
<?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>
testTradeModelLine
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.tests.testTradeModelLine
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testTradeModelLine
</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/
testTradeModelLinePurchase.py
→
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.
testTradeModelLinePurchase.py
View file @
f4cbf48d
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
##############################################################################
##############################################################################
import
unittest
import
unittest
from
Products.ERP5.tests
.testTradeModelLine
import
TestTradeModelLine
from
erp5.component.test
.testTradeModelLine
import
TestTradeModelLine
class
TestTradeModelLinePurchase
(
TestTradeModelLine
):
class
TestTradeModelLinePurchase
(
TestTradeModelLine
):
invoice_portal_type
=
'Purchase Invoice Transaction'
invoice_portal_type
=
'Purchase Invoice Transaction'
...
...
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testTradeModelLinePurchase.xml
0 → 100644
View file @
f4cbf48d
<?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>
testTradeModelLinePurchase
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.tests.testTradeModelLinePurchase
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testTradeModelLinePurchase
</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_simplified_invoicing/bt/template_test_id_list
View file @
f4cbf48d
test.erp5.testBPMCore
test.erp5.testComplexTradeModelLineUseCase
test.erp5.testDeliveryBuilderToSupportMultipleLines
test.erp5.testDeliveryBuilderToSupportMultipleLines
test.erp5.testInvoice
test.erp5.testInvoice
test.erp5.testSimulationPerformance
test.erp5.testTradeCondition
test.erp5.testTradeModelLine
test.erp5.testTradeModelLinePurchase
\ No newline at end of file
bt5/erp5_simplified_invoicing/bt/test_dependency_list
View file @
f4cbf48d
...
@@ -5,9 +5,10 @@ erp5_simulation
...
@@ -5,9 +5,10 @@ erp5_simulation
erp5_apparel
erp5_apparel
erp5_project
erp5_project
erp5_configurator_standard_solver
erp5_configurator_standard_solver
erp5_simulation_test_trade_template
erp5_simulation_test
erp5_simulation_test
erp5_simulation_test_trade_template
erp5_administration
erp5_administration
erp5_dummy_movement
erp5_dummy_movement
erp5_configurator_standard_accounting_template
erp5_configurator_standard_accounting_template
erp5_configurator_standard_invoicing_template
erp5_configurator_standard_invoicing_template
erp5_item
\ 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