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
fda3ba4c
Commit
fda3ba4c
authored
Oct 03, 2022
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5:
* check kthat correct release/type have been selected * get price from sale supply
parent
64977f1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
9 deletions
+36
-9
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
...mponents/test.erp5.testSlapOSERP5VirtualMasterScenario.py
+36
-9
No files found.
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
View file @
fda3ba4c
...
@@ -174,6 +174,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
...
@@ -174,6 +174,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
)
)
public_server_software
=
self
.
generateNewSoftwareReleaseUrl
()
public_server_software
=
self
.
generateNewSoftwareReleaseUrl
()
public_instance_type
=
'public type'
# XXX who create the product
# XXX who create the product
# define the security
# define the security
...
@@ -218,21 +219,45 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
...
@@ -218,21 +219,45 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
)
)
software_product
.
newContent
(
software_product
.
newContent
(
portal_type
=
"Software Product Release Variation"
,
portal_type
=
"Software Product Release Variation"
,
title
=
"my super release"
,
title
=
"my old release"
,
url_string
=
public_server_software
+
'-1'
)
release_variation
=
software_product
.
newContent
(
portal_type
=
"Software Product Release Variation"
,
title
=
"my current release"
,
url_string
=
public_server_software
url_string
=
public_server_software
)
)
software_product
.
newContent
(
portal_type
=
"Software Product Release Variation"
,
title
=
"my futur release"
,
url_string
=
public_server_software
+
'+1'
)
software_product
.
newContent
(
software_product
.
newContent
(
portal_type
=
"Software Product Type Variation"
,
portal_type
=
"Software Product Type Variation"
,
title
=
"my super type"
title
=
public_instance_type
+
'-1'
)
type_variation
=
software_product
.
newContent
(
portal_type
=
"Software Product Type Variation"
,
title
=
public_instance_type
)
software_product
.
newContent
(
portal_type
=
"Software Product Type Variation"
,
title
=
public_instance_type
+
'+1'
)
)
software_product
.
validate
()
software_product
.
validate
()
sale_supply
=
self
.
portal
.
sale_supply_module
.
newContent
(
portal_type
=
"Sale Supply"
,
destination_project_value
=
project
,
price_currency
=
"currency_module/EUR"
)
# XXX Put price in sale supply module
# XXX Put price in sale supply module
sale_
trade_condition
.
newContent
(
sale_
supply
.
newContent
(
portal_type
=
"Sale Supply Line"
,
portal_type
=
"Sale Supply Line"
,
base_price
=
9
,
base_price
=
9
,
resource_value
=
software_product
resource_value
=
software_product
)
)
sale_supply
.
validate
()
# some preparation
# some preparation
self
.
logout
()
self
.
logout
()
...
@@ -280,7 +305,6 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
...
@@ -280,7 +305,6 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
reference
=
public_reference
).
getParentValue
()
reference
=
public_reference
).
getParentValue
()
public_instance_title
=
'Public title %s'
%
self
.
generateNewId
()
public_instance_title
=
'Public title %s'
%
self
.
generateNewId
()
public_instance_type
=
'public type'
self
.
checkInstanceAllocation
(
public_person
.
getUserId
(),
self
.
checkInstanceAllocation
(
public_person
.
getUserId
(),
public_reference
,
public_instance_title
,
public_reference
,
public_instance_title
,
public_server_software
,
public_instance_type
,
public_server_software
,
public_instance_type
,
...
@@ -336,10 +360,12 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
...
@@ -336,10 +360,12 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
})
})
assert
len
(
inventory_list
)
==
1
,
len
(
inventory_list
)
assert
len
(
inventory_list
)
==
1
,
len
(
inventory_list
)
assert
inventory_list
[
0
].
quantity
==
1
,
inventory_list
[
0
].
quantity
assert
inventory_list
[
0
].
quantity
==
1
,
inventory_list
[
0
].
quantity
resource_vcl
=
list
(
software_product
.
getVariationCategoryList
(
resource_vcl
=
[
omit_individual_variation
=
0
))
'software_release/%s'
%
release_variation
.
getRelativeUrl
(),
'software_type/%s'
%
type_variation
.
getRelativeUrl
()
]
resource_vcl
.
sort
()
resource_vcl
.
sort
()
assert
inventory_list
[
0
].
getVariationCategoryList
()
==
resource_vcl
,
inventory_list
[
0
].
getVariationCategoryList
(
)
assert
inventory_list
[
0
].
getVariationCategoryList
()
==
resource_vcl
,
"%s %s"
%
(
resource_vcl
,
inventory_list
[
0
].
getVariationCategoryList
()
)
# Check accounting
# Check accounting
transaction_list
=
self
.
portal
.
account_module
.
receivable
.
Account_getAccountingTransactionList
(
mirror_section_uid
=
public_person
.
getUid
())
transaction_list
=
self
.
portal
.
account_module
.
receivable
.
Account_getAccountingTransactionList
(
mirror_section_uid
=
public_person
.
getUid
())
...
@@ -359,11 +385,12 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
...
@@ -359,11 +385,12 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
# 7 simulation mvt
# 7 simulation mvt
# 1 software product
# 1 software product
# 1 sale trace condition, 1 supply line
# 1 sale trace condition
# 1 supply, 1 supply line
# 1 open order line / 1 cell
# 1 open order line / 1 cell
related_object_list
=
project
.
Base_getRelatedObjectList
(
**
{
'category.category_strict_membership'
:
1
})
related_object_list
=
project
.
Base_getRelatedObjectList
(
**
{
'category.category_strict_membership'
:
1
})
assert
len
(
related_object_list
)
==
2
5
,
[
x
.
getRelativeUrl
()
for
x
in
related_object_list
]
assert
len
(
related_object_list
)
==
2
6
,
[
x
.
getRelativeUrl
()
for
x
in
related_object_list
]
self
.
stepcheckERP5Consistency
()
self
.
stepcheckERP5Consistency
()
...
...
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