Commit 7080efca authored by Rafael Monnerat's avatar Rafael Monnerat

Check If Price Currency are copied from Order to Packing List using simulation.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21078 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8a69a436
......@@ -46,6 +46,8 @@ class TestPackingListMixin(TestOrderMixin):
stepCreateOrganisation2 \
stepCreateOrganisation3 \
stepCreateOrder \
stepCreateCurrency \
stepSetOrderPriceCurrency \
stepSetOrderProfile \
stepCreateNotVariatedResource \
stepTic \
......@@ -66,6 +68,8 @@ class TestPackingListMixin(TestOrderMixin):
stepCreateOrganisation2 \
stepCreateOrganisation3 \
stepCreateOrder \
stepCreateCurrency \
stepSetOrderPriceCurrency \
stepSetOrderProfile \
stepCreateNotVariatedResource \
stepTic \
......@@ -91,6 +95,8 @@ class TestPackingListMixin(TestOrderMixin):
stepCreateOrganisation2 \
stepCreateOrganisation3 \
stepCreateOrder \
stepCreateCurrency \
stepSetOrderPriceCurrency \
stepSetOrderProfile \
stepCreateVariatedResource \
stepTic \
......@@ -144,6 +150,8 @@ class TestPackingListMixin(TestOrderMixin):
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 @@ class TestPackingListMixin(TestOrderMixin):
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment