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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
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):
...
@@ -344,7 +344,7 @@ class TestTradeModelLine(TestTradeModelLineMixin):
packing_list
.
stop
()
packing_list
.
stop
()
transaction
.
commit
()
transaction
.
commit
()
self
.
tic
()
self
.
tic
()
self
.
stepInvoiceBuilderAlarm
()
self
.
buildInvoices
()
transaction
.
commit
()
transaction
.
commit
()
self
.
tic
()
self
.
tic
()
...
@@ -478,21 +478,15 @@ class TestTradeModelLine(TestTradeModelLineMixin):
...
@@ -478,21 +478,15 @@ class TestTradeModelLine(TestTradeModelLineMixin):
self
.
assertEquals
(
str
(
abs
(
line_dict
[
'income_expense'
])),
self
.
assertEquals
(
str
(
abs
(
line_dict
[
'income_expense'
])),
str
(
rounded_total_price
+
rounded_discount_price
))
str
(
rounded_total_price
+
rounded_discount_price
))
def
stepPackingListBuilderAlarm
(
self
,
sequence
=
None
,
def
buildPackingLists
(
self
):
sequence_list
=
None
,
**
kw
):
self
.
portal
.
portal_alarms
.
packing_list_builder_alarm
.
activeSense
()
# global builder alarm does not exist in legacy simulation
transaction
.
commit
()
# business templates.
self
.
tic
()
alarm
=
getattr
(
self
.
portal
.
portal_alarms
,
'packing_list_builder_alarm'
,
None
)
if
alarm
is
not
None
:
def
buildInvoices
(
self
):
alarm
.
activeSense
()
self
.
portal
.
portal_alarms
.
invoice_builder_alarm
.
activeSense
()
transaction
.
commit
()
def
stepInvoiceBuilderAlarm
(
self
,
sequence
=
None
,
self
.
tic
()
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
()
###
###
## Test cases
## Test cases
...
@@ -606,9 +600,7 @@ class TestTradeModelLine(TestTradeModelLineMixin):
...
@@ -606,9 +600,7 @@ class TestTradeModelLine(TestTradeModelLineMixin):
order
.
confirm
()
order
.
confirm
()
transaction
.
commit
()
transaction
.
commit
()
self
.
tic
()
self
.
tic
()
self
.
stepPackingListBuilderAlarm
()
self
.
buildPackingLists
()
transaction
.
commit
()
self
.
tic
()
packing_list
,
=
order
.
getCausalityRelatedValueList
(
packing_list
,
=
order
.
getCausalityRelatedValueList
(
portal_type
=
self
.
packing_list_portal_type
)
portal_type
=
self
.
packing_list_portal_type
)
...
@@ -937,9 +929,7 @@ return lambda *args, **kw: 1""")
...
@@ -937,9 +929,7 @@ return lambda *args, **kw: 1""")
order
.
confirm
()
order
.
confirm
()
transaction
.
commit
()
transaction
.
commit
()
self
.
tic
()
self
.
tic
()
self
.
stepPackingListBuilderAlarm
()
self
.
buildPackingLists
()
transaction
.
commit
()
self
.
tic
()
packing_list
=
order
.
getCausalityRelatedValue
(
packing_list
=
order
.
getCausalityRelatedValue
(
portal_type
=
self
.
packing_list_portal_type
)
portal_type
=
self
.
packing_list_portal_type
)
...
@@ -951,9 +941,7 @@ return lambda *args, **kw: 1""")
...
@@ -951,9 +941,7 @@ return lambda *args, **kw: 1""")
packing_list
.
deliver
()
packing_list
.
deliver
()
transaction
.
commit
()
transaction
.
commit
()
self
.
tic
()
self
.
tic
()
self
.
stepInvoiceBuilderAlarm
()
self
.
buildInvoices
()
transaction
.
commit
()
self
.
tic
()
invoice
=
packing_list
.
getCausalityRelatedValue
(
invoice
=
packing_list
.
getCausalityRelatedValue
(
portal_type
=
self
.
invoice_portal_type
)
portal_type
=
self
.
invoice_portal_type
)
...
...
product/ERP5Legacy/tests/testLegacyTradeModelLine.py
View file @
67bccd94
...
@@ -52,6 +52,9 @@ for name in list(TestTradeModelLine.__dict__):
...
@@ -52,6 +52,9 @@ for name in list(TestTradeModelLine.__dict__):
if
'_NewSimulation_'
in
name
:
if
'_NewSimulation_'
in
name
:
delattr
(
TestTradeModelLine
,
name
)
delattr
(
TestTradeModelLine
,
name
)
TestTradeModelLine
.
buildInvoices
=
TestTradeModelLine
.
buildPackingLists
=
\
lambda
self
:
None
def
createBusinessProcess
(
self
,
*
args
,
**
kw
):
def
createBusinessProcess
(
self
,
*
args
,
**
kw
):
business_process
=
super
(
TestTradeModelLine
,
self
)
\
business_process
=
super
(
TestTradeModelLine
,
self
)
\
.
createBusinessProcess
(
*
args
,
**
kw
)
.
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