Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Léo-Paul Géneau
erp5
Commits
fa5e107e
Commit
fa5e107e
authored
Jan 16, 2023
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_pdm: add get preferred variation vategory test
parent
16a5460d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
bt5/erp5_pdm/TestTemplateItem/portal_components/test.erp5.testResourceVariation.py
...Item/portal_components/test.erp5.testResourceVariation.py
+21
-0
No files found.
bt5/erp5_pdm/TestTemplateItem/portal_components/test.erp5.testResourceVariation.py
View file @
fa5e107e
...
...
@@ -169,6 +169,7 @@ class ResourceVariationTestCase(ERP5TypeTestCase):
preference
.
setPreferredProductOptionalVariationBaseCategory
(
value
)
preference
.
setPreferredServiceOptionalVariationBaseCategory
(
value
)
preference
.
setPreferredComponentOptionalVariationBaseCategory
(
value
)
self
.
preference
=
preference
# all this available to catalog
...
...
@@ -702,6 +703,26 @@ class TestResourceVariation(ResourceVariationTestCase):
individual_variation_base_category
=
'individual_aspect'
)
self
.
_testResourceVariation
(
component
)
def
testResourceGetVariationBaseCategoryValueAfterChangePreference
(
self
):
# Resource Variation test.
self
.
logMessage
(
'testResourceGetVariationBaseCategoryValueAfterChangePreference'
)
product
=
self
.
_makeOneResource
(
id
=
'6'
,
portal_type
=
'Product'
,
title
=
'Product Six'
,
validation_state
=
'validated'
)
self
.
tic
()
self
.
assertEqual
([(
'Individual Aspect'
,
'individual_aspect'
)],
product
.
Resource_getIndividualVariationBaseCategoryItemList
())
self
.
assertEqual
([(
'Optional Colour'
,
'option_colour'
)],
product
.
Resource_getOptionalVariationBaseCategoryItemList
())
self
.
assertEqual
([(
'Required Size'
,
'required_size'
)],
product
.
Resource_getVariationBaseCategoryItemList
())
self
.
preference
.
setPreferredProductIndividualVariationBaseCategoryList
([])
self
.
preference
.
setPreferredProductVariationBaseCategoryList
([])
self
.
preference
.
setPreferredProductOptionalVariationBaseCategoryList
([])
self
.
tic
()
self
.
assertEqual
([],
product
.
Resource_getIndividualVariationBaseCategoryItemList
())
self
.
assertEqual
([],
product
.
Resource_getOptionalVariationBaseCategoryItemList
())
self
.
assertEqual
([],
product
.
Resource_getVariationBaseCategoryItemList
())
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestResourceVariation
))
...
...
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