Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
Hamza
erp5-Boxiang
Commits
67bccd94
Commit
67bccd94
authored
Mar 26, 2012
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testTradeModelLine: simplify code triggering builders
parent
35be87ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
25 deletions
+16
-25
product/ERP5/tests/testTradeModelLine.py
product/ERP5/tests/testTradeModelLine.py
+13
-25
product/ERP5Legacy/tests/testLegacyTradeModelLine.py
product/ERP5Legacy/tests/testLegacyTradeModelLine.py
+3
-0
No files found.
product/ERP5/tests/testTradeModelLine.py
View file @
67bccd94
...
...
@@ -344,7 +344,7 @@ class TestTradeModelLine(TestTradeModelLineMixin):
packing_list
.
stop
()
transaction
.
commit
()
self
.
tic
()
self
.
stepInvoiceBuilderAlarm
()
self
.
buildInvoices
()
transaction
.
commit
()
self
.
tic
()
...
...
@@ -478,21 +478,15 @@ class TestTradeModelLine(TestTradeModelLineMixin):
self
.
assertEquals
(
str
(
abs
(
line_dict
[
'income_expense'
])),
str
(
rounded_total_price
+
rounded_discount_price
))
def
stepPackingListBuilderAlarm
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
# global builder alarm does not exist in legacy simulation
# business templates.
alarm
=
getattr
(
self
.
portal
.
portal_alarms
,
'packing_list_builder_alarm'
,
None
)
if
alarm
is
not
None
:
alarm
.
activeSense
()
def
stepInvoiceBuilderAlarm
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
# global builder alarm does not exist in legacy simulation
# business templates.
alarm
=
getattr
(
self
.
portal
.
portal_alarms
,
'invoice_builder_alarm'
,
None
)
if
alarm
is
not
None
:
alarm
.
activeSense
()
def
buildPackingLists
(
self
):
self
.
portal
.
portal_alarms
.
packing_list_builder_alarm
.
activeSense
()
transaction
.
commit
()
self
.
tic
()
def
buildInvoices
(
self
):
self
.
portal
.
portal_alarms
.
invoice_builder_alarm
.
activeSense
()
transaction
.
commit
()
self
.
tic
()
###
## Test cases
...
...
@@ -606,9 +600,7 @@ class TestTradeModelLine(TestTradeModelLineMixin):
order
.
confirm
()
transaction
.
commit
()
self
.
tic
()
self
.
stepPackingListBuilderAlarm
()
transaction
.
commit
()
self
.
tic
()
self
.
buildPackingLists
()
packing_list
,
=
order
.
getCausalityRelatedValueList
(
portal_type
=
self
.
packing_list_portal_type
)
...
...
@@ -937,9 +929,7 @@ return lambda *args, **kw: 1""")
order
.
confirm
()
transaction
.
commit
()
self
.
tic
()
self
.
stepPackingListBuilderAlarm
()
transaction
.
commit
()
self
.
tic
()
self
.
buildPackingLists
()
packing_list
=
order
.
getCausalityRelatedValue
(
portal_type
=
self
.
packing_list_portal_type
)
...
...
@@ -951,9 +941,7 @@ return lambda *args, **kw: 1""")
packing_list
.
deliver
()
transaction
.
commit
()
self
.
tic
()
self
.
stepInvoiceBuilderAlarm
()
transaction
.
commit
()
self
.
tic
()
self
.
buildInvoices
()
invoice
=
packing_list
.
getCausalityRelatedValue
(
portal_type
=
self
.
invoice_portal_type
)
...
...
product/ERP5Legacy/tests/testLegacyTradeModelLine.py
View file @
67bccd94
...
...
@@ -52,6 +52,9 @@ for name in list(TestTradeModelLine.__dict__):
if
'_NewSimulation_'
in
name
:
delattr
(
TestTradeModelLine
,
name
)
TestTradeModelLine
.
buildInvoices
=
TestTradeModelLine
.
buildPackingLists
=
\
lambda
self
:
None
def
createBusinessProcess
(
self
,
*
args
,
**
kw
):
business_process
=
super
(
TestTradeModelLine
,
self
)
\
.
createBusinessProcess
(
*
args
,
**
kw
)
...
...
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