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
0
Merge Requests
0
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
Rafael Monnerat
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):
...
@@ -673,20 +673,25 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
self
.
tic
()
self
.
tic
()
amount
=
sum
([
i
.
total_price
for
i
in
person
.
Entity_getOutstandingDepositAmountList
(
outstanding_amount_list
=
person
.
Entity_getOutstandingDepositAmountList
(
currency
.
getUid
(),
ledger_uid
=
subscription_request
.
getLedgerUid
())])
currency
.
getUid
(),
ledger_uid
=
subscription_request
.
getLedgerUid
())
self
.
assertEqual
(
amount
,
deposit_amount
)
self
.
assertEqual
(
sum
([
i
.
total_price
for
i
in
outstanding_amount_list
]),
deposit_amount
)
# Action to submit project subscription
def
wrapWithShadow
(
_person
,
*
arg
):
self
.
login
(
person
.
getUserId
())
return
_person
.
Entity_addDepositPayment
(
*
arg
)
# Ensure to pay from the website
payment_transaction
=
person
.
Person_restrictMethodAsShadowUser
(
outstanding_amount
=
self
.
web_site
.
restrictedTraverse
(
outstanding_amount_list
[
0
].
getRelativeUrl
())
shadow_document
=
person
,
outstanding_amount
.
Base_createExternalPaymentTransactionFromOutstandingAmountAndRedirect
()
callable_object
=
wrapWithShadow
,
argument_list
=
[
person
,
deposit_amount
,
currency
.
getRelativeUrl
()])
self
.
tic
()
self
.
tic
()
self
.
logout
()
self
.
logout
()
self
.
login
()
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
# payzen interface will only stop the payment
payment_transaction
.
stop
()
payment_transaction
.
stop
()
self
.
tic
()
self
.
tic
()
...
...
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
View file @
42b1a116
...
@@ -486,6 +486,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -486,6 +486,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
shadow_document
=
owner_person
,
shadow_document
=
owner_person
,
callable_object
=
wrapWithShadow
,
callable_object
=
wrapWithShadow
,
argument_list
=
[
owner_person
,
total_price
,
currency
.
getRelativeUrl
()])
argument_list
=
[
owner_person
,
total_price
,
currency
.
getRelativeUrl
()])
self
.
tic
()
self
.
tic
()
self
.
logout
()
self
.
logout
()
self
.
login
()
self
.
login
()
...
@@ -860,20 +861,23 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -860,20 +861,23 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# Pay deposit to validate virtual master + one computer
# Pay deposit to validate virtual master + one computer
deposit_amount
=
42.0
+
99.0
deposit_amount
=
42.0
+
99.0
ledger
=
self
.
portal
.
portal_categories
.
ledger
.
automated
ledger
=
self
.
portal
.
portal_categories
.
ledger
.
automated
amount
=
sum
([
i
.
total_price
for
i
in
project_owner_person
.
Entity_getOutstandingDepositAmountList
(
amount
=
sum
([
i
.
total_price
for
i
in
project_owner_person
.
Entity_getOutstandingDepositAmountList
(
currency
.
getUid
(),
ledger_uid
=
ledger
.
getUid
())])
currency
.
getUid
(),
ledger_uid
=
ledger
.
getUid
())])
self
.
assertEqual
(
amount
,
deposit_amount
)
self
.
assertEqual
(
amount
,
deposit_amount
)
def
wrapWithShadow
(
_person
,
*
arg
):
project_owner_person
.
Entity_createExternalPaymentTransactionFromDepositAndRedirect
(
return
_person
.
Entity_addDepositPayment
(
*
arg
)
currency
.
getReference
())
payment_transaction
=
project_owner_person
.
Person_restrictMethodAsShadowUser
(
shadow_document
=
project_owner_person
,
callable_object
=
wrapWithShadow
,
argument_list
=
[
project_owner_person
,
deposit_amount
,
currency
.
getRelativeUrl
()])
self
.
tic
()
self
.
tic
()
self
.
logout
()
self
.
logout
()
self
.
login
()
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
()
payment_transaction
.
stop
()
self
.
tic
()
self
.
tic
()
assert
payment_transaction
.
receivable
.
getGroupingReference
(
None
)
is
not
None
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