[Erp5-report] r21078 - /erp5/trunk/products/ERP5/tests/testPackingList.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed May 21 23:50:55 CEST 2008
Author: rafael
Date: Wed May 21 23:50:55 2008
New Revision: 21078
URL: http://svn.erp5.org?rev=21078&view=rev
Log:
Check If Price Currency are copied from Order to Packing List using simulation.
Modified:
erp5/trunk/products/ERP5/tests/testPackingList.py
Modified: erp5/trunk/products/ERP5/tests/testPackingList.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testPackingList.py?rev=21078&r1=21077&r2=21078&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testPackingList.py (original)
+++ erp5/trunk/products/ERP5/tests/testPackingList.py Wed May 21 23:50:55 2008
@@ -46,6 +46,8 @@
stepCreateOrganisation2 \
stepCreateOrganisation3 \
stepCreateOrder \
+ stepCreateCurrency \
+ stepSetOrderPriceCurrency \
stepSetOrderProfile \
stepCreateNotVariatedResource \
stepTic \
@@ -66,6 +68,8 @@
stepCreateOrganisation2 \
stepCreateOrganisation3 \
stepCreateOrder \
+ stepCreateCurrency \
+ stepSetOrderPriceCurrency \
stepSetOrderProfile \
stepCreateNotVariatedResource \
stepTic \
@@ -91,6 +95,8 @@
stepCreateOrganisation2 \
stepCreateOrganisation3 \
stepCreateOrder \
+ stepCreateCurrency \
+ stepSetOrderPriceCurrency \
stepSetOrderProfile \
stepCreateVariatedResource \
stepTic \
@@ -144,6 +150,8 @@
order.getDestinationAdministration())
self.assertEquals(packing_list.getSourceAdministration(), \
order.getSourceAdministration())
+ self.assertEquals(packing_list.getPriceCurrency(), \
+ order.getPriceCurrency())
def stepCheckPackingListIsDivergent(self, sequence=None, sequence_list=None,
packing_list=None,**kw):
@@ -628,7 +636,32 @@
self.stepCheckPackingListIsPacked(sequence=sequence,
packing_list=packing_list)
-
+ def stepCreateCurrency(self, sequence, **kw) :
+ """Create a default currency. """
+ currency_module = self.getCurrencyModule()
+ if len(currency_module.objectValues(id='EUR'))==0:
+ currency = self.getCurrencyModule().newContent(
+ portal_type='Currency',
+ id="EUR",
+ base_unit_quantity=0.01,
+ )
+ else:
+ currency = currency_module.objectValues(id='EUR')[0]
+ sequence.edit(currency=currency)
+
+ def stepSetOrderPriceCurrency(self, sequence, **kw) :
+ """Set the price currency of the order.
+
+ This step is not necessary.
+ TODO : - include a test without this step.
+ - include a test with this step late.
+ """
+ currency = sequence.get('currency')
+ order = sequence.get('order')
+ order.setPriceCurrency(currency.getRelativeUrl())
+
+
+
class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) :
run_all_test = 1
More information about the Erp5-report
mailing list