From ac86b0f801bfd59bb606967a7fbe2a284be10f7a Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Fri, 25 Jun 2010 15:47:55 +0000
Subject: [PATCH] add one more simple test.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36606 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/tests/testERP5Simulation.py | 31 ++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/product/ERP5/tests/testERP5Simulation.py b/product/ERP5/tests/testERP5Simulation.py
index d9ba4991a6..0d4475cf78 100644
--- a/product/ERP5/tests/testERP5Simulation.py
+++ b/product/ERP5/tests/testERP5Simulation.py
@@ -633,11 +633,17 @@ class TestAutomaticSolvingPackingList(TestERP5SimulationMixin, TestPackingListMi
     self.portal.portal_rules.new_delivery_simulation_rule.quantity_tester.edit(
       solver=('portal_solvers/Automatic Quantity Accept Solver',))
 
+  def stepSetUpAutomaticQuantityAdoptSolver(self, sequence=None, sequence_list=None):
+    self._setUpTargetSolver('Automatic Quantity Adopt Solver',
+                            'AdoptSolver', ('quantity',))
+    self.portal.portal_rules.new_delivery_simulation_rule.quantity_tester.edit(
+      solver=('portal_solvers/Automatic Quantity Adopt Solver',))
+
   def test_01_PackingListDecreaseQuantity(self, quiet=quiet):
     """
       Change the quantity on an delivery line, then
-      see if the packing list is divergent and then
-      split and defer the packing list
+      see if the packing list is solved automatically
+      with accept solver.
     """
     sequence_list = SequenceList()
 
@@ -654,6 +660,27 @@ class TestAutomaticSolvingPackingList(TestERP5SimulationMixin, TestPackingListMi
 
     sequence_list.play(self, quiet=quiet)
 
+  def test_02_PackingListDecreaseQuantity(self, quiet=quiet):
+    """
+      Change the quantity on an delivery line, then
+      see if the packing list is solved automatically
+      with adopt solver.
+    """
+    sequence_list = SequenceList()
+
+    # Test with a simply order without cell
+    sequence_string = '\
+                      stepSetUpAutomaticQuantityAdoptSolver \
+                      ' + self.default_sequence + '\
+                      stepDecreasePackingListLineQuantity \
+                      stepCheckPackingListIsCalculating \
+                      stepTic \
+                      stepCheckPackingListIsSolved \
+                      '
+    sequence_list.addSequenceString(sequence_string)
+
+    sequence_list.play(self, quiet=quiet)
+
 def test_suite():
   suite = unittest.TestSuite()
   suite.addTest(unittest.makeSuite(TestERP5Simulation))
-- 
2.30.9