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
7c0ce5f8
Commit
7c0ce5f8
authored
Jun 02, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: test: scenario for money deposit
parent
5c671166
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
...mponents/test.erp5.testSlapOSERP5VirtualMasterScenario.py
+39
-0
No files found.
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
View file @
7c0ce5f8
...
@@ -363,6 +363,45 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -363,6 +363,45 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
assert
last_message
is
None
,
last_message
assert
last_message
is
None
,
last_message
def
test_deposit_with_accounting_scenario
(
self
):
self
.
portal
.
testromain
()
currency
,
_
,
_
,
_
=
self
.
bootstrapVirtualMasterTest
()
self
.
logout
()
# lets join as slapos administrator, which will own few compute_nodes
owner_reference
=
'owner-%s'
%
self
.
generateNewId
()
self
.
joinSlapOS
(
self
.
web_site
,
owner_reference
)
self
.
login
()
owner_person
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"ERP5 Login"
,
reference
=
owner_reference
).
getParentValue
()
self
.
tic
()
# hooray
self
.
logout
()
self
.
login
(
owner_person
.
getUserId
())
# XXX XXX do reservation payment for a huge amount, to check if other services are ok
total_price
=
1234
# Action to submit project subscription
def
wrapWithShadow
(
person
,
*
arg
):
return
person
.
Person_addDepositPayment
(
*
arg
)
payment_transaction
=
owner_person
.
Person_restrictMethodAsShadowUser
(
shadow_document
=
owner_person
,
callable_object
=
wrapWithShadow
,
argument_list
=
[
owner_person
,
total_price
,
currency
.
getRelativeUrl
(),
1
])
self
.
tic
()
self
.
logout
()
self
.
login
()
payment_transaction
.
PaymentTransaction_acceptDepositPayment
()
self
.
tic
()
assert
payment_transaction
is
not
None
assert
payment_transaction
.
receivable
.
getGroupingReference
(
None
)
is
not
None
def
test_virtual_master_with_accounting_scenario
(
self
):
def
test_virtual_master_with_accounting_scenario
(
self
):
currency
,
_
,
_
,
sale_person
=
self
.
bootstrapVirtualMasterTest
()
currency
,
_
,
_
,
sale_person
=
self
.
bootstrapVirtualMasterTest
()
...
...
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