From f0f4add473d454f4cfd4477b32c99744d6bf14da Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Fri, 19 Jun 2009 11:38:29 +0000
Subject: [PATCH] add currency on sale packing lists. This makes tests 2 tests
 working again.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27679 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/tests/testInventory.py | 8 ++++++--
 product/ERP5/tests/testOrder.py     | 4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/product/ERP5/tests/testInventory.py b/product/ERP5/tests/testInventory.py
index 96f2040db8..32ff8b9905 100644
--- a/product/ERP5/tests/testInventory.py
+++ b/product/ERP5/tests/testInventory.py
@@ -66,6 +66,7 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
   inventory_portal_type = "Inventory"
   inventory_line_portal_type = inventory_portal_type + ' Line'
   inventory_cell_portal_type = inventory_portal_type + ' Cell'
+  price_currency =  'currency_module/euro'
   
   def getTitle(self):
     return "Inventory"
@@ -87,6 +88,7 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
       return 1
     from Products.ERP5Type.Document.PackingList import PackingList
     PackingList.isPacked = isPacked
+    self.createCurrency()
 
   def createCategory(self, parent, id_list):
       last_category = None
@@ -243,7 +245,8 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
                       destination_section_value = section,
                       destination_value = node,
                       start_date = DateTime() - 2,
-                      stop_date = DateTime() - 2
+                      stop_date = DateTime() - 2,
+                      price_currency = self.price_currency
                      )
     self.assertNotEquals( packing_list.getSourceSectionValue(), None)
     self.assertNotEquals( packing_list.getSourceValue(), None)
@@ -521,6 +524,7 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
       property_list = [(x[0], organisation_list[x[1]].getRelativeUrl()) for x in property_list] + \
                       [x for x in data.items() if x[0] in ('start_date',)]
       property_dict = {}
+      property_dict['price_currency'] = self.price_currency
       for (id, value) in property_list: property_dict[id] = value
       packing_list.edit(**property_dict)
       for line in data['lines']:
@@ -1872,7 +1876,7 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
 
     sequence_list.play(self)
 
-  def test_02_InventoryModuleWithVariation(self, quiet=0, run=run_all_test):
+  def test_03_InventoryModuleWithVariation(self, quiet=0, run=run_all_test):
     """
       Test the InventoryModule behavior
     """
diff --git a/product/ERP5/tests/testOrder.py b/product/ERP5/tests/testOrder.py
index dad7726d38..0ecd9f5267 100644
--- a/product/ERP5/tests/testOrder.py
+++ b/product/ERP5/tests/testOrder.py
@@ -76,6 +76,10 @@ class TestOrderMixin:
     self.createCategories()
     self.validateRules()
 
+  def createCurrency(self):
+    portal = self.getPortal()
+    portal.currency_module.newContent(id='euro', reference='EUR', title='EURO')
+
   def createCategories(self):
     """
       Light install create only base categories, so we create
-- 
2.30.9