Commit 9cc5cfd1 authored by Jérome Perrin's avatar Jérome Perrin

I was wrong, we never wanted to drop omit_simulation support.

Add tests for omit_simulation



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9784 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6b696094
This diff is collapsed.
...@@ -78,6 +78,12 @@ ...@@ -78,6 +78,12 @@
<dictionary/> <dictionary/>
</value> </value>
</item> </item>
<item>
<key> <string>omit_simulation</string> </key>
<value>
<dictionary/>
</value>
</item>
<item> <item>
<key> <string>order_by_expression</string> </key> <key> <string>order_by_expression</string> </key>
<value> <value>
...@@ -126,18 +132,19 @@ ...@@ -126,18 +132,19 @@
<key> <string>_keys</string> </key> <key> <string>_keys</string> </key>
<value> <value>
<list> <list>
<string>from_table_list</string> <string>from_table_list</string>
<string>where_expression</string> <string>where_expression</string>
<string>order_by_expression</string> <string>order_by_expression</string>
<string>selection_domain</string> <string>selection_domain</string>
<string>selection_report</string> <string>selection_report</string>
<string>ignore_variation</string> <string>ignore_variation</string>
<string>standardize</string> <string>standardize</string>
<string>omit_input</string> <string>omit_simulation</string>
<string>omit_output</string> <string>omit_input</string>
<string>input_simulation_state</string> <string>omit_output</string>
<string>output_simulation_state</string> <string>input_simulation_state</string>
<string>group_by_expression</string> <string>output_simulation_state</string>
<string>group_by_expression</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -167,6 +174,7 @@ selection_domain\r\n ...@@ -167,6 +174,7 @@ selection_domain\r\n
selection_report\r\n selection_report\r\n
ignore_variation\r\n ignore_variation\r\n
standardize\r\n standardize\r\n
omit_simulation\r\n
omit_input\r\n omit_input\r\n
omit_output\r\n omit_output\r\n
input_simulation_state:list\r\n input_simulation_state:list\r\n
...@@ -249,6 +257,10 @@ WHERE\n ...@@ -249,6 +257,10 @@ WHERE\n
AND node.uid = stock.node_uid\n AND node.uid = stock.node_uid\n
AND resource.uid = stock.resource_uid\n AND resource.uid = stock.resource_uid\n
\n \n
<dtml-if omit_simulation>\n
AND catalog.portal_type != \'Simulation Movement\'\n
</dtml-if>\n
\n
<dtml-if omit_input>\n <dtml-if omit_input>\n
AND stock.quantity < 0\n AND stock.quantity < 0\n
AND ( stock.node_uid <> stock.mirror_node_uid\n AND ( stock.node_uid <> stock.mirror_node_uid\n
...@@ -375,6 +387,10 @@ WHERE\n ...@@ -375,6 +387,10 @@ WHERE\n
AND node.uid = stock.node_uid\n AND node.uid = stock.node_uid\n
AND resource.uid = stock.resource_uid\n AND resource.uid = stock.resource_uid\n
\n \n
<dtml-if omit_simulation>\n
AND catalog.portal_type != \'Simulation Movement\'\n
</dtml-if>\n
\n
<dtml-if omit_input>\n <dtml-if omit_input>\n
AND stock.quantity < 0\n AND stock.quantity < 0\n
AND ( stock.node_uid <> stock.mirror_node_uid\n AND ( stock.node_uid <> stock.mirror_node_uid\n
......
...@@ -86,6 +86,12 @@ ...@@ -86,6 +86,12 @@
<dictionary/> <dictionary/>
</value> </value>
</item> </item>
<item>
<key> <string>omit_simulation</string> </key>
<value>
<dictionary/>
</value>
</item>
<item> <item>
<key> <string>order_by_expression</string> </key> <key> <string>order_by_expression</string> </key>
<value> <value>
...@@ -134,18 +140,19 @@ ...@@ -134,18 +140,19 @@
<key> <string>_keys</string> </key> <key> <string>_keys</string> </key>
<value> <value>
<list> <list>
<string>from_table_list</string> <string>from_table_list</string>
<string>where_expression</string> <string>where_expression</string>
<string>order_by_expression</string> <string>order_by_expression</string>
<string>group_by_expression</string> <string>group_by_expression</string>
<string>selection_domain</string> <string>selection_domain</string>
<string>selection_report</string> <string>selection_report</string>
<string>ignore_variation</string> <string>ignore_variation</string>
<string>standardize</string> <string>standardize</string>
<string>omit_input</string> <string>omit_simulation</string>
<string>omit_output</string> <string>omit_input</string>
<string>input_simulation_state</string> <string>omit_output</string>
<string>output_simulation_state</string> <string>input_simulation_state</string>
<string>output_simulation_state</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -176,6 +183,7 @@ selection_domain\r\n ...@@ -176,6 +183,7 @@ selection_domain\r\n
selection_report\r\n selection_report\r\n
ignore_variation\r\n ignore_variation\r\n
standardize\r\n standardize\r\n
omit_simulation\r\n
omit_input\r\n omit_input\r\n
omit_output\r\n omit_output\r\n
input_simulation_state:list\r\n input_simulation_state:list\r\n
...@@ -258,6 +266,10 @@ WHERE\n ...@@ -258,6 +266,10 @@ WHERE\n
AND node.uid = stock.node_uid\n AND node.uid = stock.node_uid\n
AND resource.uid = stock.resource_uid\n AND resource.uid = stock.resource_uid\n
\n \n
<dtml-if omit_simulation>\n
AND catalog.portal_type != \'Simulation Movement\'\n
</dtml-if>\n
\n
<dtml-if omit_input>\n <dtml-if omit_input>\n
AND stock.quantity < 0\n AND stock.quantity < 0\n
AND ( stock.node_uid <> stock.mirror_node_uid\n AND ( stock.node_uid <> stock.mirror_node_uid\n
...@@ -391,6 +403,10 @@ WHERE\n ...@@ -391,6 +403,10 @@ WHERE\n
AND node.uid = stock.node_uid\n AND node.uid = stock.node_uid\n
AND resource.uid = stock.resource_uid\n AND resource.uid = stock.resource_uid\n
\n \n
<dtml-if omit_simulation>\n
AND catalog.portal_type != \'Simulation Movement\'\n
</dtml-if>\n
\n
<dtml-if omit_input>\n <dtml-if omit_input>\n
AND stock.quantity < 0\n AND stock.quantity < 0\n
AND ( stock.node_uid <> stock.mirror_node_uid\n AND ( stock.node_uid <> stock.mirror_node_uid\n
......
...@@ -78,6 +78,12 @@ ...@@ -78,6 +78,12 @@
<dictionary/> <dictionary/>
</value> </value>
</item> </item>
<item>
<key> <string>omit_simulation</string> </key>
<value>
<dictionary/>
</value>
</item>
<item> <item>
<key> <string>order_by_expression</string> </key> <key> <string>order_by_expression</string> </key>
<value> <value>
...@@ -126,18 +132,19 @@ ...@@ -126,18 +132,19 @@
<key> <string>_keys</string> </key> <key> <string>_keys</string> </key>
<value> <value>
<list> <list>
<string>from_table_list</string> <string>from_table_list</string>
<string>where_expression</string> <string>where_expression</string>
<string>order_by_expression</string> <string>order_by_expression</string>
<string>group_by_expression</string> <string>group_by_expression</string>
<string>selection_domain</string> <string>selection_domain</string>
<string>selection_report</string> <string>selection_report</string>
<string>ignore_variation</string> <string>ignore_variation</string>
<string>standardize</string> <string>standardize</string>
<string>omit_input</string> <string>omit_simulation</string>
<string>omit_output</string> <string>omit_input</string>
<string>input_simulation_state</string> <string>omit_output</string>
<string>output_simulation_state</string> <string>input_simulation_state</string>
<string>output_simulation_state</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -577,6 +584,7 @@ selection_domain\r\n ...@@ -577,6 +584,7 @@ selection_domain\r\n
selection_report\r\n selection_report\r\n
ignore_variation\r\n ignore_variation\r\n
standardize\r\n standardize\r\n
omit_simulation\r\n
omit_input\r\n omit_input\r\n
omit_output\r\n omit_output\r\n
input_simulation_state:list\r\n input_simulation_state:list\r\n
...@@ -656,6 +664,10 @@ WHERE\n ...@@ -656,6 +664,10 @@ WHERE\n
AND node.uid = stock.node_uid\n AND node.uid = stock.node_uid\n
AND resource.uid = stock.resource_uid\n AND resource.uid = stock.resource_uid\n
\n \n
<dtml-if omit_simulation>\n
AND catalog.portal_type != \'Simulation Movement\'\n
</dtml-if>\n
\n
<dtml-if omit_input>\n <dtml-if omit_input>\n
AND stock.quantity < 0\n AND stock.quantity < 0\n
AND ( stock.node_uid <> stock.mirror_node_uid\n AND ( stock.node_uid <> stock.mirror_node_uid\n
...@@ -786,6 +798,10 @@ WHERE\n ...@@ -786,6 +798,10 @@ WHERE\n
AND node.uid = stock.node_uid\n AND node.uid = stock.node_uid\n
AND resource.uid = stock.resource_uid\n AND resource.uid = stock.resource_uid\n
\n \n
<dtml-if omit_simulation>\n
AND catalog.portal_type != \'Simulation Movement\'\n
</dtml-if>\n
\n
<dtml-if omit_input>\n <dtml-if omit_input>\n
AND stock.quantity < 0\n AND stock.quantity < 0\n
AND ( stock.node_uid <> stock.mirror_node_uid\n AND ( stock.node_uid <> stock.mirror_node_uid\n
......
...@@ -76,6 +76,12 @@ ...@@ -76,6 +76,12 @@
<dictionary/> <dictionary/>
</value> </value>
</item> </item>
<item>
<key> <string>omit_simulation</string> </key>
<value>
<dictionary/>
</value>
</item>
<item> <item>
<key> <string>query</string> </key> <key> <string>query</string> </key>
<value> <value>
...@@ -152,21 +158,22 @@ ...@@ -152,21 +158,22 @@
<key> <string>_keys</string> </key> <key> <string>_keys</string> </key>
<value> <value>
<list> <list>
<string>query</string> <string>query</string>
<string>resource_uid</string> <string>resource_uid</string>
<string>from_date</string> <string>from_date</string>
<string>at_date</string> <string>at_date</string>
<string>to_date</string> <string>to_date</string>
<string>omit_input</string> <string>omit_simulation</string>
<string>omit_output</string> <string>omit_input</string>
<string>simulation_state</string> <string>omit_output</string>
<string>section_category</string> <string>simulation_state</string>
<string>selection_domain</string> <string>section_category</string>
<string>selection_report</string> <string>selection_domain</string>
<string>closed_summary</string> <string>selection_report</string>
<string>where_expression</string> <string>closed_summary</string>
<string>from_table_list</string> <string>where_expression</string>
<string>selection_uids</string> <string>from_table_list</string>
<string>selection_uids</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -194,6 +201,7 @@ resource_uid:list\r\n ...@@ -194,6 +201,7 @@ resource_uid:list\r\n
from_date\r\n from_date\r\n
at_date\r\n at_date\r\n
to_date\r\n to_date\r\n
omit_simulation\r\n
omit_input\r\n omit_input\r\n
omit_output\r\n omit_output\r\n
simulation_state:list\r\n simulation_state:list\r\n
...@@ -295,6 +303,9 @@ WHERE\n ...@@ -295,6 +303,9 @@ WHERE\n
<dtml-if to_date>\n <dtml-if to_date>\n
AND stock.date < <dtml-sqlvar to_date type="datetime">\n AND stock.date < <dtml-sqlvar to_date type="datetime">\n
</dtml-if>\n </dtml-if>\n
<dtml-if omit_simulation>\n
AND catalog.portal_type != \'Simulation Movement\'\n
</dtml-if>\n
<dtml-if omit_input>\n <dtml-if omit_input>\n
AND stock.quantity < 0\n AND stock.quantity < 0\n
AND (stock.node_uid <> stock.mirror_node_uid\n AND (stock.node_uid <> stock.mirror_node_uid\n
...@@ -435,6 +446,9 @@ WHERE\n ...@@ -435,6 +446,9 @@ WHERE\n
<dtml-if to_date>\n <dtml-if to_date>\n
AND stock.date < <dtml-sqlvar to_date type="datetime">\n AND stock.date < <dtml-sqlvar to_date type="datetime">\n
</dtml-if>\n </dtml-if>\n
<dtml-if omit_simulation>\n
AND catalog.portal_type != \'Simulation Movement\'\n
</dtml-if>\n
<dtml-if omit_input>\n <dtml-if omit_input>\n
AND stock.quantity < 0\n AND stock.quantity < 0\n
AND (stock.node_uid <> stock.mirror_node_uid\n AND (stock.node_uid <> stock.mirror_node_uid\n
......
2006-09-04 jerome
* remove omit_simulation parameter in all inventory API ZSQLMethods.
2006-08-25 Stefan 2006-08-25 Stefan
* Update naming convention script. * Update naming convention script.
......
55 56
\ No newline at end of file \ No newline at end of file
...@@ -270,6 +270,15 @@ class TestInventory(InventoryAPITestCase): ...@@ -270,6 +270,15 @@ class TestInventory(InventoryAPITestCase):
# not accountable movement are not counted by getInventory # not accountable movement are not counted by getInventory
get_transaction().commit(); self.tic() # (after reindexing of course) get_transaction().commit(); self.tic() # (after reindexing of course)
self.assertEquals(100, getInventory(section_uid=self.section.getUid())) self.assertEquals(100, getInventory(section_uid=self.section.getUid()))
def test_OmitSimulation(self, quiet=0, run=RUN_ALL_TESTS):
"""Test omit_simulation argument to getInventory.
"""
getInventory = self.getSimulationTool().getInventory
self._makeSimulationMovement(quantity=100)
self._makeMovement(quantity=100)
self.assertEquals(100, getInventory(section_uid=self.section.getUid(),
omit_simulation=1))
def test_SectionCategory(self, quiet=0, run=RUN_ALL_TESTS): def test_SectionCategory(self, quiet=0, run=RUN_ALL_TESTS):
"""Tests inventory on section category. """ """Tests inventory on section category. """
...@@ -819,7 +828,28 @@ class TestMovementHistoryList(InventoryAPITestCase): ...@@ -819,7 +828,28 @@ class TestMovementHistoryList(InventoryAPITestCase):
section_uid=self.section.getUid()) section_uid=self.section.getUid())
self.assertEquals(len(movement_history_list), 2) self.assertEquals(len(movement_history_list), 2)
def test_SimulationMovement(self, quiet=0, run=RUN_ALL_TESTS):
"""Test simulation movement are listed in getMovementHistoryList
"""
getMovementHistoryList = self.getSimulationTool().getMovementHistoryList
self._makeSimulationMovement(quantity=100)
self._makeMovement(quantity=100)
movement_history_list = getMovementHistoryList(
section_uid=self.section.getUid())
self.assertEquals(2, len(movement_history_list))
def test_OmitSimulation(self, quiet=0, run=RUN_ALL_TESTS):
"""Test omit_simulation argument to getMovementHistoryList.
"""
getMovementHistoryList = self.getSimulationTool().getMovementHistoryList
self._makeSimulationMovement(quantity=100)
self._makeMovement(quantity=100)
movement_history_list = getMovementHistoryList(
section_uid=self.section.getUid(),
omit_simulation=1)
self.assertEquals(1, len(movement_history_list))
self.assertEquals(100, movement_history_list[0].quantity)
class TestInventoryStat(InventoryAPITestCase): class TestInventoryStat(InventoryAPITestCase):
"""Tests Inventory Stat methods. """Tests Inventory Stat methods.
""" """
......
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