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
Paul Graydon
erp5
Commits
7ddef46b
Commit
7ddef46b
authored
Jan 16, 2023
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_apparel: add test for ApparelModelColourAndMorphologieVariation_init
parent
6d68b19b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
bt5/erp5_apparel/TestTemplateItem/portal_components/test.erp5.testApparelModel.py
...plateItem/portal_components/test.erp5.testApparelModel.py
+20
-0
No files found.
bt5/erp5_apparel/TestTemplateItem/portal_components/test.erp5.testApparelModel.py
View file @
7ddef46b
...
...
@@ -164,6 +164,26 @@ class TestApparelModel(ERP5TypeTestCase):
self
.
assertIn
(
'composition/elasthane'
,
index
)
self
.
assertIn
(
'composition/acrylique'
,
index
)
def
test_apparel_model_content_init
(
self
):
portal
=
self
.
getPortalObject
()
preference
=
getattr
(
portal
.
portal_preferences
,
'test_site_preference'
,
None
)
if
preference
is
None
:
preference
=
portal
.
portal_preferences
.
newContent
(
portal_type
=
'System Preference'
,
title
=
'Default Site Preference'
,
id
=
'test_site_preference'
)
if
preference
.
getPreferenceState
()
==
'disabled'
:
preference
.
enable
()
preference
.
setPreferredApparelModelIndividualVariationBaseCategoryList
([
'size'
])
self
.
tic
()
apparel_model_module
=
portal
.
getDefaultModule
(
'Apparel Model'
)
apparel_model
=
apparel_model_module
.
newContent
(
portal_type
=
'Apparel Model'
)
colour_variation
=
apparel_model
.
newContent
(
portal_type
=
'Apparel Model Colour Variation'
)
self
.
assertEqual
(
colour_variation
.
getVariationBaseCategoryList
(),
[])
preference
.
setPreferredApparelModelIndividualVariationBaseCategoryList
([
'colour'
])
self
.
tic
()
colour_variation
=
apparel_model
.
newContent
(
portal_type
=
'Apparel Model Colour Variation'
)
self
.
assertEqual
(
colour_variation
.
getVariationBaseCategoryList
(),
[
'colour'
])
def
test_checkCopyColourRangeVariation
(
self
):
'''
Check that it's possible to copy colour range variation from a model, and
...
...
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