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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
42b1a116
Commit
42b1a116
authored
May 24, 2024
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5&cloud: (test) Use same action the end-user will call
parent
82bda8f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
18 deletions
+27
-18
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
...omponents/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
+16
-11
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
...mponents/test.erp5.testSlapOSERP5VirtualMasterScenario.py
+11
-7
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
View file @
42b1a116
...
...
@@ -673,20 +673,25 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
self
.
tic
()
amount
=
sum
([
i
.
total_price
for
i
in
person
.
Entity_getOutstandingDepositAmountList
(
currency
.
getUid
(),
ledger_uid
=
subscription_request
.
getLedgerUid
())])
self
.
assertEqual
(
amount
,
deposit_amount
)
# Action to submit project subscription
def
wrapWithShadow
(
_person
,
*
arg
):
return
_person
.
Entity_addDepositPayment
(
*
arg
)
payment_transaction
=
person
.
Person_restrictMethodAsShadowUser
(
shadow_document
=
person
,
callable_object
=
wrapWithShadow
,
argument_list
=
[
person
,
deposit_amount
,
currency
.
getRelativeUrl
()])
outstanding_amount_list
=
person
.
Entity_getOutstandingDepositAmountList
(
currency
.
getUid
(),
ledger_uid
=
subscription_request
.
getLedgerUid
())
self
.
assertEqual
(
sum
([
i
.
total_price
for
i
in
outstanding_amount_list
]),
deposit_amount
)
self
.
login
(
person
.
getUserId
())
# Ensure to pay from the website
outstanding_amount
=
self
.
web_site
.
restrictedTraverse
(
outstanding_amount_list
[
0
].
getRelativeUrl
())
outstanding_amount
.
Base_createExternalPaymentTransactionFromOutstandingAmountAndRedirect
()
self
.
tic
()
self
.
logout
()
self
.
login
()
payment_transaction
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Payment Transaction"
,
destination_section_uid
=
person
.
getUid
(),
simulation_state
=
"started"
)
self
.
assertEqual
(
payment_transaction
.
getSpecialiseValue
().
getTradeConditionType
(),
"deposit"
)
# payzen interface will only stop the payment
payment_transaction
.
stop
()
self
.
tic
()
...
...
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
View file @
42b1a116
...
...
@@ -486,6 +486,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
shadow_document
=
owner_person
,
callable_object
=
wrapWithShadow
,
argument_list
=
[
owner_person
,
total_price
,
currency
.
getRelativeUrl
()])
self
.
tic
()
self
.
logout
()
self
.
login
()
...
...
@@ -860,20 +861,23 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# Pay deposit to validate virtual master + one computer
deposit_amount
=
42.0
+
99.0
ledger
=
self
.
portal
.
portal_categories
.
ledger
.
automated
amount
=
sum
([
i
.
total_price
for
i
in
project_owner_person
.
Entity_getOutstandingDepositAmountList
(
currency
.
getUid
(),
ledger_uid
=
ledger
.
getUid
())])
self
.
assertEqual
(
amount
,
deposit_amount
)
def
wrapWithShadow
(
_person
,
*
arg
):
return
_person
.
Entity_addDepositPayment
(
*
arg
)
payment_transaction
=
project_owner_person
.
Person_restrictMethodAsShadowUser
(
shadow_document
=
project_owner_person
,
callable_object
=
wrapWithShadow
,
argument_list
=
[
project_owner_person
,
deposit_amount
,
currency
.
getRelativeUrl
()])
project_owner_person
.
Entity_createExternalPaymentTransactionFromDepositAndRedirect
(
currency
.
getReference
())
self
.
tic
()
self
.
logout
()
self
.
login
()
# payzen interface will only stop the payment
payment_transaction
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Payment Transaction"
,
destination_section_uid
=
project_owner_person
.
getUid
(),
simulation_state
=
"started"
)
self
.
assertEqual
(
payment_transaction
.
getSpecialiseValue
().
getTradeConditionType
(),
"deposit"
)
# payzen/wechat or accountant will only stop the payment
payment_transaction
.
stop
()
self
.
tic
()
assert
payment_transaction
.
receivable
.
getGroupingReference
(
None
)
is
not
None
...
...
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