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
Titouan Soulard
slapos.core
Commits
f35bd9cb
Commit
f35bd9cb
authored
Feb 27, 2023
by
Romain Courteaud
🐸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: testSlapOSAccountingSkins update to latest changes
parent
d779899b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
49 deletions
+31
-49
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingSkins.py
.../portal_components/test.erp5.testSlapOSAccountingSkins.py
+31
-49
No files found.
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingSkins.py
View file @
f35bd9cb
...
...
@@ -72,6 +72,7 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
destination_reference
=
new_destination_reference
,
destination_section
=
destination_section
,
payment_mode
=
payment_mode
,
ledger
=
'automated'
,
specialise
=
"sale_trade_condition_module/slapos_aggregated_trade_condition"
,
created_by_builder
=
1
# to prevent init script to create lines
)
...
...
@@ -130,31 +131,6 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
date
=
item
.
HostingSubscription_calculateSubscriptionStartDate
()
self
.
assertEqual
(
date
,
DateTime
(
'2012/11/30'
))
@
withAbort
def
test_IT_calculateSubscriptionStartDate_withRequestAfterDestroy
(
self
):
item
=
self
.
createInstanceTree
()
destroy_date
=
DateTime
(
'2012/10/30 11:11'
)
request_date
=
DateTime
(
'2012/11/30 11:11'
)
item
.
workflow_history
[
'instance_slap_interface_workflow'
]
=
[]
item
.
workflow_history
[
'instance_slap_interface_workflow'
].
append
({
'comment'
:
'Directly destroy'
,
'error_message'
:
''
,
'actor'
:
'ERP5TypeTestCase'
,
'slap_state'
:
'destroy_requested'
,
'time'
:
destroy_date
,
'action'
:
'request_destroy'
})
item
.
workflow_history
[
'instance_slap_interface_workflow'
].
append
({
'comment'
:
'Directly request the instance'
,
'error_message'
:
''
,
'actor'
:
'ERP5TypeTestCase'
,
'slap_state'
:
'draft'
,
'time'
:
request_date
,
'action'
:
'request_instance'
})
date
=
item
.
InstanceTree_calculateSubscriptionStartDate
()
self
.
assertEqual
(
date
,
DateTime
(
'2012/10/30'
))
@
withAbort
def
test_HS_calculateSubscriptionStopDate_REQUEST_disallowed
(
self
):
item
=
self
.
createInstanceTree
()
...
...
@@ -303,23 +279,9 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
sale_invoice_transaction
.
SaleInvoiceTransaction_resetPaymentMode
,
REQUEST
=
{})
def
test_Person_get_set_AggregatedDelivery
(
self
):
person
=
self
.
makePerson
()
self
.
assertEqual
(
person
.
Person_getAggregatedDelivery
(),
None
)
delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
"Sale Packing List"
)
person
.
Person_setAggregatedDelivery
(
delivery
)
self
.
assertEqual
(
delivery
,
person
.
Person_getAggregatedDelivery
())
def
test_AccountingTransactionModule_getUnpaidInvoiceList
(
self
):
person
=
self
.
makePerson
(
user
=
1
)
project
=
self
.
addProject
()
person
=
self
.
makePerson
(
project
,
user
=
1
)
template
=
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
portal_preferences
.
getPreferredDefaultPrePaymentSubscriptionInvoiceTemplate
())
...
...
@@ -461,6 +423,16 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
invoice
.
SaleInvoiceTransaction_createReversalSaleInvoiceTransaction
,
batch_mode
=
1
)
@
withAbort
def
test_createReversalSaleInvoiceTransaction_wrong_ledger
(
self
,
payment_mode
=
'payzen'
):
invoice
=
self
.
createSaleInvoiceTransactionForReversal
(
payment_mode
=
payment_mode
)
invoice
.
edit
(
ledger
=
None
)
self
.
tic
()
self
.
assertRaises
(
AssertionError
,
invoice
.
SaleInvoiceTransaction_createReversalSaleInvoiceTransaction
,
batch_mode
=
1
)
@
withAbort
def
test_createReversalSaleInvoiceTransaction_paid
(
self
,
payment_mode
=
'payzen'
):
invoice
=
self
.
createSaleInvoiceTransactionForReversal
(
payment_mode
=
payment_mode
)
...
...
@@ -622,6 +594,10 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
def
test_createReversalSaleInvoiceTransaction_wechat_wrong_trade_condition
(
self
):
self
.
test_createReversalSaleInvoiceTransaction_wrong_trade_condition
(
payment_mode
=
'wechat'
)
@
withAbort
def
test_createReversalSaleInvoiceTransaction_wechat_wrong_ledger
(
self
):
self
.
test_createReversalSaleInvoiceTransaction_wrong_ledger
(
payment_mode
=
'wechat'
)
@
withAbort
def
test_createReversalSaleInvoiceTransaction_wechat_paid
(
self
):
self
.
test_createReversalSaleInvoiceTransaction_paid
(
payment_mode
=
'wechat'
)
...
...
@@ -732,30 +708,34 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
self
.
assertEqual
(
"Pay Now"
,
invoice
.
AccountingTransaction_getPaymentState
())
def
test_AccountingTransaction_getPaymentState_payzen_paynow_payment
(
self
):
person
=
self
.
makePerson
()
project
=
self
.
addProject
()
person
=
self
.
makePerson
(
project
)
invoice
=
self
.
createStoppedSaleInvoiceTransaction
(
destination_section
=
person
.
getRelativeUrl
()
)
destination_section
_value
=
person
)
self
.
tic
()
self
.
login
(
person
.
getUserId
())
self
.
assertEqual
(
"Pay Now"
,
invoice
.
AccountingTransaction_getPaymentState
())
def
test_AccountingTransaction_getPaymentState_wechat_paynow_payment
(
self
):
person
=
self
.
makePerson
()
project
=
self
.
addProject
()
person
=
self
.
makePerson
(
project
)
invoice
=
self
.
createStoppedSaleInvoiceTransaction
(
destination_section
=
person
.
getRelativeUrl
()
,
destination_section
_value
=
person
,
payment_mode
=
"wechat"
)
self
.
tic
()
self
.
login
(
person
.
getUserId
())
self
.
assertEqual
(
"Pay Now"
,
invoice
.
AccountingTransaction_getPaymentState
())
def
test_AccountingTransaction_getPaymentState_payzen_waiting_payment
(
self
):
person
=
self
.
makePerson
()
project
=
self
.
addProject
()
person
=
self
.
makePerson
(
project
)
invoice
=
self
.
createStoppedSaleInvoiceTransaction
(
destination_section
=
person
.
getRelativeUrl
()
)
destination_section
_value
=
person
)
payment
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
"Payment Transaction"
,
payment_mode
=
'payzen'
,
ledger
=
'automated'
,
causality_value
=
invoice
,
destination_section
=
invoice
.
getDestinationSection
(),
created_by_builder
=
1
# to prevent init script to create lines
...
...
@@ -768,14 +748,16 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
invoice
.
AccountingTransaction_getPaymentState
())
def
test_AccountingTransaction_getPaymentState_wechat_waiting_payment
(
self
):
person
=
self
.
makePerson
()
project
=
self
.
addProject
()
person
=
self
.
makePerson
(
project
)
invoice
=
self
.
createStoppedSaleInvoiceTransaction
(
destination_section
=
person
.
getRelativeUrl
()
,
destination_section
_value
=
person
,
payment_mode
=
'wechat'
)
payment
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
"Payment Transaction"
,
payment_mode
=
'wechat'
,
ledger
=
'automated'
,
causality_value
=
invoice
,
destination_section
=
invoice
.
getDestinationSection
(),
created_by_builder
=
1
# to prevent init script to create lines
...
...
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