Commit 2c3391cb authored by Julien Muchembled's avatar Julien Muchembled

Use products instead of currencies in testInventoryAPI.

Will be required to test unit conversion.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21231 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent eecf0fd0
...@@ -76,6 +76,10 @@ class InventoryAPITestCase(ERP5TypeTestCase): ...@@ -76,6 +76,10 @@ class InventoryAPITestCase(ERP5TypeTestCase):
""" the apparel fabric module """ """ the apparel fabric module """
return getattr(self.getPortal(),'apparel_fabric_item_module') return getattr(self.getPortal(),'apparel_fabric_item_module')
def getProductModule(self):
return getattr(self.getPortal(), 'product',
getattr(self.getPortal(), 'product_module'))
def afterSetUp(self): def afterSetUp(self):
"""set up """ """set up """
self.createCategories() self.createCategories()
...@@ -98,12 +102,12 @@ class InventoryAPITestCase(ERP5TypeTestCase): ...@@ -98,12 +102,12 @@ class InventoryAPITestCase(ERP5TypeTestCase):
portal_type='Bank Account') portal_type='Bank Account')
self.mirror_section = self._makeOrganisation(title='Mirror Section') self.mirror_section = self._makeOrganisation(title='Mirror Section')
self.mirror_node = self._makeOrganisation(title='Mirror Node') self.mirror_node = self._makeOrganisation(title='Mirror Node')
self.resource = self.getCurrencyModule().newContent( self.resource = self.getProductModule().newContent(
title='Resource', title='Resource',
portal_type='Currency') portal_type='Product')
self.other_resource = self.getCurrencyModule().newContent( self.other_resource = self.getProductModule().newContent(
title='Other Resource', title='Other Resource',
portal_type='Currency') portal_type='Product')
self.item = self.getItemModule().newContent(title='Item') self.item = self.getItemModule().newContent(title='Item')
self.other_item = self.getItemModule().newContent(title='Other Item') self.other_item = self.getItemModule().newContent(title='Other Item')
# create a dummy Rule, to be able to create simulation movements # create a dummy Rule, to be able to create simulation movements
...@@ -125,7 +129,7 @@ class InventoryAPITestCase(ERP5TypeTestCase): ...@@ -125,7 +129,7 @@ class InventoryAPITestCase(ERP5TypeTestCase):
self._safeTic() self._safeTic()
for module in [ 'organisation_module', for module in [ 'organisation_module',
'person_module', 'person_module',
'currency_module', 'product_module',
'portal_simulation', 'portal_simulation',
'inventory_module', 'inventory_module',
self.folder.getId() ]: self.folder.getId() ]:
...@@ -183,7 +187,7 @@ class InventoryAPITestCase(ERP5TypeTestCase): ...@@ -183,7 +187,7 @@ class InventoryAPITestCase(ERP5TypeTestCase):
""" erp5_trade is required for transit_simulation_state """ erp5_trade is required for transit_simulation_state
erp5_apparel is required for item erp5_apparel is required for item
""" """
return ('erp5_base', 'erp5_dummy_movement', 'erp5_trade', 'erp5_apparel') return ('erp5_base', 'erp5_pdm', 'erp5_dummy_movement', 'erp5_trade', 'erp5_apparel')
# TODO: move this to a base class {{{ # TODO: move this to a base class {{{
@reindex @reindex
...@@ -212,14 +216,14 @@ class InventoryAPITestCase(ERP5TypeTestCase): ...@@ -212,14 +216,14 @@ class InventoryAPITestCase(ERP5TypeTestCase):
return sit return sit
@reindex @reindex
def _makeCurrency(self, **kw): def _makeProduct(self, **kw):
"""Creates a currency.""" """Creates a product."""
currency = self.getCurrencyModule().newContent( product = self.getProductModule().newContent(
portal_type = 'Currency', **kw) portal_type = 'Product', **kw)
get_transaction().commit() get_transaction().commit()
self.tic() self.tic()
return currency return product
_makeResource = _makeCurrency _makeResource = _makeProduct
# }}} # }}}
@reindex @reindex
......
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