From e46d98c62f8c77e55aa1c45255b805138cb52582 Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Fri, 8 Apr 2005 16:16:30 +0000
Subject: [PATCH] Test getVariationTest on SimulationMovement.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2854 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/tests/testOrder.py | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/product/ERP5/tests/testOrder.py b/product/ERP5/tests/testOrder.py
index fd10cc0279..31a73becd9 100755
--- a/product/ERP5/tests/testOrder.py
+++ b/product/ERP5/tests/testOrder.py
@@ -359,7 +359,8 @@ class TestOrder(ERP5TypeTestCase):
                                 portal_type=self.cell_portal_type, *cell_key)
       cell.edit(mapped_value_property_list=['price','quantity'],
                 price=price, quantity=quantity)
-      cell.setPredicateCategoryList( cell_key )
+      cell.setPredicateCategoryList(cell_key)
+      cell.setVariationCategoryList(cell_key)
       price += 1
       quantity += 1
 
@@ -1005,6 +1006,16 @@ class TestOrder(ERP5TypeTestCase):
     order_line = sequence.get('order_line')
     cell = order_line.getCellValueList()[0]
     self.checkAcquisition(cell, order_line)
+    # Test resource
+    self.assertEquals(order_line.getResource(), \
+                      cell.getResource())
+    # Test resource variation
+    cvcl = cell.getVariationCategoryList()
+    olvcl = order_line.getVariationCategoryList()
+    self.assertEquals(len(order_line.getVariationRangeBaseCategoryList()), \
+                      len(cvcl))
+    for variation_category in cvcl:
+      self.failUnless(variation_category in olvcl)
 
   def test_11_testPropertiesAcquisition(self, quiet=0, run=run_all_test):
     """
@@ -1088,6 +1099,9 @@ class TestOrder(ERP5TypeTestCase):
         # Test resource
         self.assertEquals(order_movement.getResource(), \
                           simulation_movement.getResource())
+        # Test resource variation
+        self.assertEquals(order_movement.getVariationText(), \
+                          simulation_movement.getVariationText())
         # XXX Test acquisition
         self.checkAcquisition(simulation_movement, order_movement)
         # Test other attributes
-- 
2.30.9