Commit 5a2c520a authored by Yusei Tahara's avatar Yusei Tahara

[ERP5/tests/testERP5Commerce.py] Category must be defined before creating products and web sites.

parent af8a1249
......@@ -128,6 +128,12 @@ class TestCommerce(ERP5TypeTestCase):
sale_order_module.manage_permission('Access contents information',
roles=['Anonymous'], acquire=0)
# 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')
# create default currency (EUR)
currency = currency_module.newContent(portal_type='Currency',
id='EUR')
......@@ -176,12 +182,6 @@ class TestCommerce(ERP5TypeTestCase):
self.website.setProperty('ecommerce_base_currency',
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.loginByUserName('ivan')
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