Commit af8a1249 authored by Yusei Tahara's avatar Yusei Tahara

[ERP5/tests/testERP5Commerce.py] quantity_unit/unit/piece category is used but...

[ERP5/tests/testERP5Commerce.py] quantity_unit/unit/piece category is used but it does not exist in this test. Add quantity_unit/unit/piece in afterSetUp.

To use non-existing category may lead an unexpected result. This time, getAcquiredCategoryList did not work correctly, then category values of products were not correctly indexed and test_17_getProductListFromWebSection failed.
parent a2a6f262
...@@ -176,6 +176,12 @@ class TestCommerce(ERP5TypeTestCase): ...@@ -176,6 +176,12 @@ class TestCommerce(ERP5TypeTestCase):
self.website.setProperty('ecommerce_base_currency', self.website.setProperty('ecommerce_base_currency',
currency.getRelativeUrl()) currency.getRelativeUrl())
# add quantity_unit/unit/piece
if getattr(self.portal.portal_categories.quantity_unit, 'unit', None) is None:
self.portal.portal_categories.quantity_unit.newContent(id='unit')
if getattr(self.portal.portal_categories.quantity_unit.unit, 'piece', None) is None:
self.portal.portal_categories.quantity_unit.unit.newContent(id='piece')
self.app.REQUEST.set('session_id', SESSION_ID) self.app.REQUEST.set('session_id', SESSION_ID)
self.loginByUserName('ivan') self.loginByUserName('ivan')
self.tic() self.tic()
......
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