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
735249a3
Commit
735249a3
authored
Sep 22, 2022
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: add hardcoded test to expand an open order
parent
57e4882e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
0 deletions
+97
-0
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
...mponents/test.erp5.testSlapOSERP5VirtualMasterScenario.py
+97
-0
No files found.
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
View file @
735249a3
...
...
@@ -154,6 +154,103 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
self
.
stepcheckERP5Consistency
()
# after accept, an email is send containing the reset link
last_message
=
self
.
portal
.
MailHost
.
_last_message
assert
last_message
is
None
,
last_message
def
test_open_order_scenario
(
self
):
# create a default project
project
=
self
.
addProject
()
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
"Person"
,
default_email_coordinate_text
=
'a@example.org'
,
)
sale_trade_condition
=
self
.
portal
.
sale_trade_condition_module
.
newContent
(
portal_type
=
"Sale Trade Condition"
,
reference
=
'slapos_ultimate_trade_condition'
,
# XXX hardcoded
specialise
=
"business_process_module/slapos_ultimate_business_process"
)
sale_trade_condition
.
newContent
(
portal_type
=
"Trade Model Line"
,
reference
=
"VAT"
,
resource
=
"service_module/slapos_tax"
,
base_application
=
"base_amount/invoicing/taxable"
,
trade_phase
=
"slapos/tax"
,
price
=
0.2
,
quantity
=
1.0
,
membership_criterion_base_category
=
(
'price_currency'
,),
membership_criterion_category
=
(
'price_currency/currency_module/EUR'
,)
)
sale_trade_condition
.
validate
()
for
_
in
range
(
1
):
hosting_subscription
=
self
.
portal
.
hosting_subscription_module
.
newContent
(
portal_type
=
"Hosting Subscription"
,
# XXX hardcoded
ledger
=
"automated"
,
)
hosting_subscription
.
validate
()
start_date
=
hosting_subscription
.
HostingSubscription_calculateSubscriptionStartDate
()
# create open order
open_sale_order
=
self
.
portal
.
open_sale_order_module
.
newContent
(
portal_type
=
"Open Sale Order"
,
ledger
=
hosting_subscription
.
getLedger
(),
destination_project_value
=
project
,
source
=
'organisation_module/slapos'
,
source_section
=
'organisation_module/slapos'
,
destination_value
=
person
,
destination_section_value
=
person
,
destination_decision_value
=
person
,
price_currency
=
'currency_module/EUR'
,
payment_mode
=
"payzen"
,
start_date
=
start_date
,
# Ensure stop date value is higher than start date
# it will be updated by OpenSaleOrder_updatePeriod
stop_date
=
start_date
+
1
,
specialise_value
=
sale_trade_condition
)
open_sale_order
.
newContent
(
portal_type
=
"Open Sale Order Line"
,
quantity
=
10
,
price
=
2
,
resource
=
'service_module/slapos_virtual_master_subscription'
,
aggregate_value
=
[
hosting_subscription
,
project
]
)
open_sale_order
.
order
()
open_sale_order
.
validate
()
self
.
tic
()
# XXX Do this for every scenario tests
self
.
logout
()
for
_
in
range
(
20
):
self
.
stepCallAlarmList
()
self
.
tic
()
self
.
login
()
# Ensure no unexpected object has been created
# destination project:
# 1 open order
# 2 accounting transaction
# 1 packing list
# 7 simulation mvt
# aggregate:
# 1 invoice line
# 1 packing list line
# 1 open order line
related_object_list
=
project
.
Base_getRelatedObjectList
(
**
{
'category.category_strict_membership'
:
1
})
assert
len
(
related_object_list
)
==
14
,
[
x
.
getRelativeUrl
()
for
x
in
related_object_list
]
self
.
stepcheckERP5Consistency
()
# after accept, an email is send containing the reset link
last_message
=
self
.
portal
.
MailHost
.
_last_message
assert
last_message
is
None
,
last_message
\ No newline at end of file
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