Commit a0930a28 authored by Romain Courteaud's avatar Romain Courteaud

Only check if variation property accessors are well generated.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3948 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2fafdd69
...@@ -61,6 +61,7 @@ class TestResource(ERP5TypeTestCase): ...@@ -61,6 +61,7 @@ class TestResource(ERP5TypeTestCase):
variation_base_category_list = ['colour', 'size', 'morphology', variation_base_category_list = ['colour', 'size', 'morphology',
'industrial_phase'] 'industrial_phase']
size_list = ['size/Child','size/Man'] size_list = ['size/Child','size/Man']
variation_property_list = []
def getBusinessTemplateList(self): def getBusinessTemplateList(self):
""" """
...@@ -151,7 +152,8 @@ class TestResource(ERP5TypeTestCase): ...@@ -151,7 +152,8 @@ class TestResource(ERP5TypeTestCase):
resource.edit( resource.edit(
title = "Resource" title = "Resource"
) )
sequence.edit(resource=resource) sequence.edit(resource=resource,
variation_property_list=[])
self.category_list = [] self.category_list = []
# Actually, resource has no individual variation # Actually, resource has no individual variation
for base_category in resource.getVariationBaseCategoryList(): for base_category in resource.getVariationBaseCategoryList():
...@@ -421,6 +423,45 @@ class TestResource(ERP5TypeTestCase): ...@@ -421,6 +423,45 @@ class TestResource(ERP5TypeTestCase):
if not run: return if not run: return
self.genericTest('CheckGetVariationCategoryItemListWithoutOmit') self.genericTest('CheckGetVariationCategoryItemListWithoutOmit')
def stepCheckGetVariationPropertyList(self, sequence=None,
sequence_list=None, **kw):
"""
Check if GetVariationPropertyList exists on a resource.
"""
resource = sequence.get('resource')
vpl = sequence.get('variation_property_list')
self.failIfDifferentSet(resource.getVariationPropertyList(),
vpl)
def stepCheckSetVariationPropertyList(self, sequence=None,
sequence_list=None, **kw):
"""
Check if SetVariationPropertyList exists on a resource.
And test it.
"""
resource = sequence.get('resource')
vpl = ['prop1', 'prop2']
sequence.edit(variation_property_list=vpl)
resource.setVariationPropertyList(vpl)
self.failIfDifferentSet(resource.variation_property_list,
vpl)
def test_08_variationPropertyList(self, quiet=0, run=run_all_test):
"""
Simply test if method are well generated by the property sheet.
"""
if not run: return
sequence_list = SequenceList()
# Test when resource has no variation
sequence_string = '\
CreateResource \
CheckGetVariationPropertyList \
CheckSetVariationPropertyList \
CheckGetVariationPropertyList \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
if __name__ == '__main__': if __name__ == '__main__':
framework() framework()
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment