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): ...@@ -46,6 +46,8 @@ class TestPackingListMixin(TestOrderMixin):
stepCreateOrganisation2 \ stepCreateOrganisation2 \
stepCreateOrganisation3 \ stepCreateOrganisation3 \
stepCreateOrder \ stepCreateOrder \
stepCreateCurrency \
stepSetOrderPriceCurrency \
stepSetOrderProfile \ stepSetOrderProfile \
stepCreateNotVariatedResource \ stepCreateNotVariatedResource \
stepTic \ stepTic \
...@@ -66,6 +68,8 @@ class TestPackingListMixin(TestOrderMixin): ...@@ -66,6 +68,8 @@ class TestPackingListMixin(TestOrderMixin):
stepCreateOrganisation2 \ stepCreateOrganisation2 \
stepCreateOrganisation3 \ stepCreateOrganisation3 \
stepCreateOrder \ stepCreateOrder \
stepCreateCurrency \
stepSetOrderPriceCurrency \
stepSetOrderProfile \ stepSetOrderProfile \
stepCreateNotVariatedResource \ stepCreateNotVariatedResource \
stepTic \ stepTic \
...@@ -91,6 +95,8 @@ class TestPackingListMixin(TestOrderMixin): ...@@ -91,6 +95,8 @@ class TestPackingListMixin(TestOrderMixin):
stepCreateOrganisation2 \ stepCreateOrganisation2 \
stepCreateOrganisation3 \ stepCreateOrganisation3 \
stepCreateOrder \ stepCreateOrder \
stepCreateCurrency \
stepSetOrderPriceCurrency \
stepSetOrderProfile \ stepSetOrderProfile \
stepCreateVariatedResource \ stepCreateVariatedResource \
stepTic \ stepTic \
...@@ -144,6 +150,8 @@ class TestPackingListMixin(TestOrderMixin): ...@@ -144,6 +150,8 @@ class TestPackingListMixin(TestOrderMixin):
order.getDestinationAdministration()) order.getDestinationAdministration())
self.assertEquals(packing_list.getSourceAdministration(), \ self.assertEquals(packing_list.getSourceAdministration(), \
order.getSourceAdministration()) order.getSourceAdministration())
self.assertEquals(packing_list.getPriceCurrency(), \
order.getPriceCurrency())
def stepCheckPackingListIsDivergent(self, sequence=None, sequence_list=None, def stepCheckPackingListIsDivergent(self, sequence=None, sequence_list=None,
packing_list=None,**kw): packing_list=None,**kw):
...@@ -628,6 +636,31 @@ class TestPackingListMixin(TestOrderMixin): ...@@ -628,6 +636,31 @@ class TestPackingListMixin(TestOrderMixin):
self.stepCheckPackingListIsPacked(sequence=sequence, self.stepCheckPackingListIsPacked(sequence=sequence,
packing_list=packing_list) 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) : class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) :
......
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