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
No related merge requests found
...@@ -128,6 +128,12 @@ class TestCommerce(ERP5TypeTestCase): ...@@ -128,6 +128,12 @@ class TestCommerce(ERP5TypeTestCase):
sale_order_module.manage_permission('Access contents information', sale_order_module.manage_permission('Access contents information',
roles=['Anonymous'], acquire=0) 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) # create default currency (EUR)
currency = currency_module.newContent(portal_type='Currency', currency = currency_module.newContent(portal_type='Currency',
id='EUR') id='EUR')
...@@ -176,12 +182,6 @@ class TestCommerce(ERP5TypeTestCase): ...@@ -176,12 +182,6 @@ 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