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):
simulation_state='delivered')
transaction.commit()
self.tic()
inventory_kw={'node_uid': self.node_uid,
'at_date': self.INVENTORY_DATE_3 +10}
value=self.INVENTORY_QUANTITY_3
def getCurrentInventoryPathList(resource, **kw):
# 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
self.assertEquals(True,movement in self.resource.getCurrentInventoryList(
from_date=movement.getStartDate(),
node_uid=self.node_uid))
self.assertTrue(movement.getPath() in getCurrentInventoryPathList(
self.resource,
node_uid=self.node_uid,
from_date=movement.getStartDate()))
# without optimisation
self.assertEquals(True,movement in self.resource.getCurrentInventoryList(
optimisation__=False,
from_date=movement.getStartDate(),
node_uid=self.node_uid))
self.assertTrue(movement.getPath() in getCurrentInventoryPathList(
self.resource,
optimisation__=False,
from_date=movement.getStartDate()))
class TestUnitConversion(InventoryAPITestCase):
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