Commit 643713dc authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

since the brain is not a zsqlbrain instance here, we cannot compare values...

since the brain is not a zsqlbrain instance here, we cannot compare values like 'movement in self.resource.getCurrentInventoryList(...)' but we need to compare by their paths.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30261 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a9b02462
...@@ -2270,19 +2270,23 @@ class TestInventoryDocument(InventoryAPITestCase): ...@@ -2270,19 +2270,23 @@ class TestInventoryDocument(InventoryAPITestCase):
simulation_state='delivered') simulation_state='delivered')
transaction.commit() transaction.commit()
self.tic() self.tic()
inventory_kw={'node_uid': self.node_uid,
'at_date': self.INVENTORY_DATE_3 +10} def getCurrentInventoryPathList(resource, **kw):
value=self.INVENTORY_QUANTITY_3 # the brain is not a zsqlbrain instance here, so it does not
# have getPath().
return [x.path for x in resource.getCurrentInventoryList(**kw)]
# use optimisation # use optimisation
self.assertEquals(True,movement in self.resource.getCurrentInventoryList( self.assertTrue(movement.getPath() in getCurrentInventoryPathList(
from_date=movement.getStartDate(), self.resource,
node_uid=self.node_uid)) node_uid=self.node_uid,
from_date=movement.getStartDate()))
# without optimisation # without optimisation
self.assertEquals(True,movement in self.resource.getCurrentInventoryList( self.assertTrue(movement.getPath() in getCurrentInventoryPathList(
optimisation__=False, self.resource,
from_date=movement.getStartDate(), optimisation__=False,
node_uid=self.node_uid)) from_date=movement.getStartDate()))
class TestUnitConversion(InventoryAPITestCase): class TestUnitConversion(InventoryAPITestCase):
QUANTITY_UNIT_CATEGORIES = { QUANTITY_UNIT_CATEGORIES = {
......
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