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
0
Merge Requests
0
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
Titouan Soulard
slapos.core
Commits
d52b8a7f
Commit
d52b8a7f
authored
Feb 22, 2023
by
Romain Courteaud
🐸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: test: use share code to create accountable project
parent
d9a94432
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
77 deletions
+8
-77
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
...mponents/test.erp5.testSlapOSERP5VirtualMasterScenario.py
+8
-77
No files found.
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
View file @
d52b8a7f
...
...
@@ -202,7 +202,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
def
test_virtual_master_with_accounting_scenario
(
self
):
# create a default project
project
=
self
.
addProject
()
project
=
self
.
addProject
(
is_accountable
=
True
)
self
.
web_site
=
self
.
portal
.
web_site_module
.
slapos_master_panel
preference
=
self
.
portal
.
portal_preferences
.
slapos_default_system_preference
...
...
@@ -217,41 +217,6 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
public_server_software
=
self
.
generateNewSoftwareReleaseUrl
()
public_instance_type
=
'public type'
# XXX who create the product
# define the security
organisation
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
"Organisation"
)
# XXX Hardcoded ID
organisation
.
newContent
(
portal_type
=
"Bank Account"
,
id
=
"bank_account"
)
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"
,
destination_project_value
=
project
,
source_value
=
organisation
,
source_section_value
=
organisation
,
price_currency
=
"currency_module/EUR"
)
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
()
software_product
,
release_variation
,
type_variation
=
self
.
addSoftwareProduct
(
"instance product"
,
project
,
public_server_software
,
public_instance_type
)
...
...
@@ -259,7 +224,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
sale_supply
=
self
.
portal
.
sale_supply_module
.
newContent
(
portal_type
=
"Sale Supply"
,
destination_project_value
=
project
,
price_currency
=
"currency_module/EUR"
price_currency
_value
=
project
.
getSpecialiseValue
().
getPriceCurrencyValue
()
)
# XXX Put price in sale supply module
sale_supply
.
newContent
(
...
...
@@ -1108,7 +1073,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
def
test_open_order_with_service_scenario
(
self
):
# create a default project
project
=
self
.
addProject
()
project
=
self
.
addProject
(
is_accountable
=
True
)
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
"Person"
,
default_email_coordinate_text
=
'a@example.org'
,
...
...
@@ -1117,24 +1082,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
portal_type
=
"Organisation"
)
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
()
sale_trade_condition
=
project
.
getSpecialiseValue
()
service
=
self
.
portal
.
restrictedTraverse
(
'service_module/slapos_virtual_master_subscription'
)
...
...
@@ -1158,7 +1106,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
destination_value
=
person
,
destination_section_value
=
person
,
destination_decision_value
=
person
,
price_currency
=
'currency_module/EUR'
,
price_currency
_value
=
sale_trade_condition
.
getPriceCurrencyValue
()
,
payment_mode
=
"payzen"
,
start_date
=
start_date
,
# Ensure stop date value is higher than start date
...
...
@@ -1231,7 +1179,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
def
test_open_order_with_software_product_scenario
(
self
):
# create a default project
project
=
self
.
addProject
()
project
=
self
.
addProject
(
is_accountable
=
True
)
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
"Person"
,
default_email_coordinate_text
=
'a@example.org'
,
...
...
@@ -1240,24 +1188,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
portal_type
=
"Organisation"
)
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
()
sale_trade_condition
=
project
.
getSpecialiseValue
()
software_product
=
self
.
portal
.
software_product_module
.
newContent
(
portal_type
=
"Software Product"
,
...
...
@@ -1298,7 +1229,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
destination_value
=
person
,
destination_section_value
=
person
,
destination_decision_value
=
person
,
price_currency
=
'currency_module/EUR'
,
price_currency
_value
=
sale_trade_condition
.
getPriceCurrencyValue
()
,
payment_mode
=
"payzen"
,
start_date
=
start_date
,
# Ensure stop date value is higher than start date
...
...
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