Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
de9fcdf3
Commit
de9fcdf3
authored
Nov 16, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test sale packing list state change interaction.
parent
177f34c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
1 deletion
+87
-1
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingInteractionWorkflow.py
...stTemplateItem/testSlapOSAccountingInteractionWorkflow.py
+86
-0
master/bt5/slapos_accounting/bt/revision
master/bt5/slapos_accounting/bt/revision
+1
-1
No files found.
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingInteractionWorkflow.py
View file @
de9fcdf3
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
from
Products.SlapOS.tests.testSlapOSMixin
import
\
from
Products.SlapOS.tests.testSlapOSMixin
import
\
testSlapOSMixin
testSlapOSMixin
import
transaction
import
transaction
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
class
TestSlapOSAccountingInteractionWorkflow
(
testSlapOSMixin
):
class
TestSlapOSAccountingInteractionWorkflow
(
testSlapOSMixin
):
def
beforeTearDown
(
self
):
def
beforeTearDown
(
self
):
...
@@ -189,3 +190,88 @@ class TestSlapOSAccountingInteractionWorkflow(testSlapOSMixin):
...
@@ -189,3 +190,88 @@ class TestSlapOSAccountingInteractionWorkflow(testSlapOSMixin):
batch_mode
=
1
)
batch_mode
=
1
)
finally
:
finally
:
Base
.
fixConsistency
=
Base
.
fixConsistency_call
Base
.
fixConsistency
=
Base
.
fixConsistency_call
def
_simulateDelivery_calculate
(
self
):
script_name
=
'Delivery_calculate'
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
raise
ValueError
(
'Precondition failed: %s exists in custom'
%
script_name
)
createZODBPythonScript
(
self
.
portal
.
portal_skins
.
custom
,
script_name
,
'*args, **kwargs'
,
'# Script body
\
n
'
"""portal_workflow = context.portal_workflow
portal_workflow.doActionFor(context, action='edit_action', comment='Visited by Delivery_calculate') """
)
transaction
.
commit
()
def
_dropDelivery_calculate
(
self
):
script_name
=
'Delivery_calculate'
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
script_name
)
transaction
.
commit
()
def
test_SalePackingList_calculate
(
self
):
new_id
=
self
.
generateNewId
()
newContent
=
self
.
portal
.
sale_packing_list_module
.
newContent
portal_type
=
"Sale Packing List"
cancel_spl
=
newContent
(
portal_type
=
portal_type
)
close_spl
=
newContent
(
portal_type
=
portal_type
)
confirm_spl
=
newContent
(
portal_type
=
portal_type
)
deliver_spl
=
newContent
(
portal_type
=
portal_type
)
deliver_spl
.
confirm
()
deliver_spl
.
stop
()
order_spl
=
newContent
(
portal_type
=
portal_type
)
plan_spl
=
newContent
(
portal_type
=
portal_type
)
setReady_spl
=
newContent
(
portal_type
=
portal_type
)
setReady_spl
.
confirm
()
start_spl
=
newContent
(
portal_type
=
portal_type
)
start_spl
.
confirm
()
stop_spl
=
newContent
(
portal_type
=
portal_type
)
stop_spl
.
confirm
()
submit_spl
=
newContent
(
portal_type
=
portal_type
)
self
.
_simulateDelivery_calculate
()
try
:
cancel_spl
.
cancel
()
close_spl
.
close
()
confirm_spl
.
confirm
()
deliver_spl
.
deliver
()
order_spl
.
order
()
plan_spl
.
plan
()
setReady_spl
.
setReady
()
start_spl
.
start
()
stop_spl
.
stop
()
submit_spl
.
submit
()
finally
:
self
.
_dropDelivery_calculate
()
self
.
assertEqual
(
cancel_spl
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
],
'Visited by Delivery_calculate'
)
self
.
assertEqual
(
close_spl
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
],
'Visited by Delivery_calculate'
)
self
.
assertEqual
(
confirm_spl
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
],
'Visited by Delivery_calculate'
)
self
.
assertEqual
(
deliver_spl
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
],
'Visited by Delivery_calculate'
)
self
.
assertEqual
(
order_spl
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
],
'Visited by Delivery_calculate'
)
self
.
assertEqual
(
plan_spl
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
],
'Visited by Delivery_calculate'
)
self
.
assertEqual
(
setReady_spl
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
],
'Visited by Delivery_calculate'
)
self
.
assertEqual
(
start_spl
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
],
'Visited by Delivery_calculate'
)
self
.
assertEqual
(
stop_spl
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
],
'Visited by Delivery_calculate'
)
self
.
assertEqual
(
submit_spl
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
],
'Visited by Delivery_calculate'
)
master/bt5/slapos_accounting/bt/revision
View file @
de9fcdf3
55
56
\ No newline at end of file
\ 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