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
eab4b547
Commit
eab4b547
authored
Sep 28, 2022
by
Romain Courteaud
🐸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: check accounting
parent
967691e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
...mponents/test.erp5.testSlapOSERP5VirtualMasterScenario.py
+27
-1
No files found.
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
View file @
eab4b547
...
...
@@ -190,6 +190,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
)
sale_trade_condition
.
validate
()
service
=
self
.
portal
.
restrictedTraverse
(
'service_module/slapos_virtual_master_subscription'
)
for
_
in
range
(
1
):
hosting_subscription
=
self
.
portal
.
hosting_subscription_module
.
newContent
(
...
...
@@ -223,7 +224,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
portal_type
=
"Open Sale Order Line"
,
quantity
=
10
,
price
=
2
,
resource
=
'service_module/slapos_virtual_master_subscription'
,
resource
_value
=
service
,
aggregate_value
=
[
hosting_subscription
,
project
...
...
@@ -239,6 +240,26 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
self
.
stepCallAlarmList
()
self
.
tic
()
self
.
login
()
# Check stock
inventory_list
=
self
.
portal
.
portal_simulation
.
getCurrentInventoryList
(
**
{
'group_by_section'
:
False
,
'group_by_node'
:
True
,
'group_by_variation'
:
True
,
'resource_uid'
:
service
.
getUid
(),
'node_uid'
:
person
.
getUid
(),
'project_uid'
:
project
.
getUid
(),
'ledger_uid'
:
hosting_subscription
.
getLedgerUid
()
})
assert
len
(
inventory_list
)
==
1
,
len
(
inventory_list
)
assert
inventory_list
[
0
].
quantity
==
10
,
inventory_list
[
0
].
quantity
assert
inventory_list
[
0
].
getVariationCategoryList
()
==
[],
inventory_list
[
0
].
getVariationCategoryList
()
# Check accounting
transaction_list
=
self
.
portal
.
account_module
.
receivable
.
Account_getAccountingTransactionList
(
mirror_section_uid
=
person
.
getUid
())
assert
len
(
transaction_list
)
==
1
,
len
(
transaction_list
)
assert
transaction_list
[
0
].
running_total_price
==
24
,
transaction_list
[
0
].
running_total_price
# Ensure no unexpected object has been created
# destination project:
# 1 open order
...
...
@@ -399,6 +420,11 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
assert
inventory_list
[
0
].
quantity
==
4
,
inventory_list
[
0
].
quantity
assert
inventory_list
[
0
].
getVariationCategoryList
()
==
resource_vcl
,
inventory_list
[
0
].
getVariationCategoryList
()
# Check accounting
transaction_list
=
self
.
portal
.
account_module
.
receivable
.
Account_getAccountingTransactionList
(
mirror_section_uid
=
person
.
getUid
())
assert
len
(
transaction_list
)
==
1
,
len
(
transaction_list
)
assert
transaction_list
[
0
].
running_total_price
==
14.4
,
transaction_list
[
0
].
running_total_price
# Ensure no unexpected object has been created
# destination project:
# 1 open order
...
...
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