[Erp5-report] r37192 yusuke - /erp5/trunk/products/ERP5/tests/testSupply.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jul 20 07:50:53 CEST 2010


Author: yusuke
Date: Tue Jul 20 07:50:53 2010
New Revision: 37192

URL: http://svn.erp5.org?rev=37192&view=rev
Log:
the cell of a supply line must work as same as the line.

Modified:
    erp5/trunk/products/ERP5/tests/testSupply.py

Modified: erp5/trunk/products/ERP5/tests/testSupply.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testSupply.py?rev=37192&r1=37191&r2=37192&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testSupply.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testSupply.py [utf8] Tue Jul 20 07:50:53 2010
@@ -97,6 +97,14 @@ class TestSaleSupply(TestSupplyMixin, ER
     supply_line.edit(**kw)
     return supply_line
 
+  @reindex
+  def _makeSupplyCell(self, supply_line, **kw):
+    """Creates a supply cell.
+    """
+    supply_cell = supply_line.newContent(portal_type=self.supply_cell_portal_type)
+    supply_cell.edit(**kw)
+    return supply_cell
+
   def test_01_MovementAndSupplyModification(self, quiet=0, run=run_all_test):
     """
       Check that moving timeframe of supply
@@ -111,27 +119,34 @@ class TestSaleSupply(TestSupplyMixin, ER
                               start_date_range_max='2009/01/31')
 
     supply_line = self._makeSupplyLine(supply)
+    supply_cell = self._makeSupplyCell(supply_line)
     transaction.commit()
     self.tic()
 
-    res = self.domain_tool.searchPredicateList(movement,
-                                      portal_type=self.supply_line_portal_type)
-    
+    res_line = self.domain_tool.searchPredicateList(movement,
+                                                    portal_type=self.supply_line_portal_type)
+    res_cell = self.domain_tool.searchPredicateList(movement,
+                                                    portal_type=self.supply_cell_portal_type)
+
     # ...and predicate shall be found
-    self.assertSameSet(res, [supply_line])
-    
+    self.assertSameSet(res_line, [supply_line])
+    self.assertSameSet(res_cell, [supply_cell])
+
     # timeframe is moved out of movement date...
     supply.edit(start_date_range_min='2009/02/01',
                 start_date_range_max='2009/02/28')
 
     transaction.commit()
     self.tic()
-    
-    res = self.domain_tool.searchPredicateList(movement,
-                                      portal_type=self.supply_line_portal_type)
+
+    res_line = self.domain_tool.searchPredicateList(movement,
+                                                    portal_type=self.supply_line_portal_type)
+    res_cell = self.domain_tool.searchPredicateList(movement,
+                                                    portal_type=self.supply_cell_portal_type)
 
     # ...and predicate shall NOT be found
-    self.assertSameSet(res, [])
+    self.assertSameSet(res_line, [])
+    self.assertSameSet(res_cell, [])
 
     # movement is going back into timeframe...
     movement.edit(start_date='2009/02/15')
@@ -139,11 +154,14 @@ class TestSaleSupply(TestSupplyMixin, ER
     transaction.commit()
     self.tic()
 
-    res = self.domain_tool.searchPredicateList(movement,
-                                      portal_type=self.supply_line_portal_type)
+    res_line = self.domain_tool.searchPredicateList(movement,
+                                                    portal_type=self.supply_line_portal_type)
+    res_cell = self.domain_tool.searchPredicateList(movement,
+                                                    portal_type=self.supply_cell_portal_type)
 
     # ...and predicate shall be found
-    self.assertSameSet(res, [supply_line])
+    self.assertSameSet(res_line, [supply_line])
+    self.assertSameSet(res_cell, [supply_cell])
 
   def test_02_checkLineIsReindexedOnSupplyChange(self, quiet=0, run=run_all_test):
     """




More information about the Erp5-report mailing list