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
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
Ophélie Gagnard
slapos.core
Commits
62e0bdde
Commit
62e0bdde
authored
Jan 24, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: Add test for SaleInvoiceTransaction_createSlapOSReversalTransaction
parent
92504e3c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
1 deletion
+41
-1
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingSkins.py
.../portal_components/test.erp5.testSlapOSAccountingSkins.py
+40
-1
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingSkins.xml
...portal_components/test.erp5.testSlapOSAccountingSkins.xml
+1
-0
No files found.
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingSkins.py
View file @
62e0bdde
...
...
@@ -4,7 +4,7 @@
# Copyright (c) 2012 Nexedi SA and Contributors. All Rights Reserved.
#
##############################################################################
from
erp5.component.test.SlapOSTestCaseMixin
import
SlapOSTestCaseMixin
,
withAbort
from
erp5.component.test.SlapOSTestCaseMixin
import
SlapOSTestCaseMixin
,
withAbort
,
simulate
from
zExceptions
import
Unauthorized
from
DateTime
import
DateTime
...
...
@@ -192,3 +192,42 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
Unauthorized
,
self
.
portal
.
OpenSaleOrder_reindexIfIndexedBeforeLine
,
REQUEST
=
{})
@
simulate
(
"SaleInvoiceTransaction_createReversalPayzenTransaction"
,
"*args, **kwargs"
,
"""context.portal_workflow.doActionFor(context, action='edit_action', comment='Visited by SaleInvoiceTransaction_createReversalPayzenTransaction')
return context.getParentValue()"""
)
def
test_SaleInvoiceTransaction_createSlapOSReversalTransaction_payzen
(
self
):
sale_invoice_transaction
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
"Sale Invoice Transaction"
)
sale_invoice_transaction
.
edit
(
payment_mode
=
"payzen"
)
redirect
=
sale_invoice_transaction
.
SaleInvoiceTransaction_createSlapOSReversalTransaction
()
self
.
assertTrue
(
redirect
.
endswith
(
'accounting_module?portal_status_message=Reversal%20Transaction%20created.'
),
"%s doesn't end with sale_invoice_transaction.SaleInvoiceTransaction_createSlapOSReversalTransaction()"
%
redirect
)
self
.
assertEqual
(
'Visited by SaleInvoiceTransaction_createReversalPayzenTransaction'
,
sale_invoice_transaction
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
@
simulate
(
"SaleInvoiceTransaction_createReversalWechatTransaction"
,
"*args, **kwargs"
,
"""context.portal_workflow.doActionFor(context, action='edit_action', comment='Visited by SaleInvoiceTransaction_createReversalWechatTransaction')
return context.getParentValue()"""
)
def
test_SaleInvoiceTransaction_createSlapOSReversalTransaction_wechat
(
self
):
sale_invoice_transaction
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
"Sale Invoice Transaction"
)
sale_invoice_transaction
.
edit
(
payment_mode
=
"wechat"
)
redirect
=
sale_invoice_transaction
.
SaleInvoiceTransaction_createSlapOSReversalTransaction
()
self
.
assertTrue
(
redirect
.
endswith
(
'accounting_module?portal_status_message=Reversal%20Transaction%20created.'
),
"%s doesn't end with sale_invoice_transaction.SaleInvoiceTransaction_createSlapOSReversalTransaction()"
%
redirect
)
self
.
assertEqual
(
'Visited by SaleInvoiceTransaction_createReversalWechatTransaction'
,
sale_invoice_transaction
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
def
test_SaleInvoiceTransaction_createSlapOSReversalTransaction_unknown
(
self
):
sale_invoice_transaction
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
"Sale Invoice Transaction"
)
sale_invoice_transaction
.
edit
(
payment_mode
=
"unknown"
)
redirect
=
sale_invoice_transaction
.
SaleInvoiceTransaction_createSlapOSReversalTransaction
()
self
.
assertTrue
(
redirect
.
endswith
(
'%s?portal_status_message=The%%20payment%%20mode%%20is%%20unsupported.'
%
sale_invoice_transaction
.
getRelativeUrl
()),
"%s doesn't end with %s?portal_status_message=The%%20payment%%20mode%%20is%%20unsupported."
%
(
redirect
,
sale_invoice_transaction
.
getRelativeUrl
()))
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingSkins.xml
View file @
62e0bdde
...
...
@@ -119,6 +119,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
...
...
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