Commit b6eb14af authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Cédric Le Ninivin

testInvoice: Solve divergence before setting ready the packing list + add test on Constraint

parent 4f891753
......@@ -33,6 +33,7 @@
import xml.dom.minidom
import zipfile
from Products.DCWorkflow.DCWorkflow import ValidationFailed
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import FileUpload
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
......@@ -767,6 +768,26 @@ class TestInvoiceMixin(TestPackingListMixin):
packing_list = sequence.get('packing_list')
packing_list.edit(description='This packing list was edited!')
def stepAcceptDecisionDescriptionPackingList(self,sequence=None, sequence_list=None):
packing_list = sequence.get('packing_list')
self._solveDivergence(packing_list, 'description', 'Accept Solver')
def stepAssertCausalityStateIsNotSolvedInConsistencyMessage(self,
sequence=None, sequence_list=None, **kw):
packing_list = sequence.get('packing_list')
self.assertEqual(
['Causality State is not "Solved". Please wait or take action'
+ ' for causality state to reach "Solved".'],
[str(message.message) for message in packing_list.checkConsistency()])
def stepSetReadyWorkflowTransitionIsBlockByConsistency(self,
sequence=None, sequence_list=None, **kw):
packing_list = sequence.get('packing_list')
with self.assertRaisesRegexp(ValidationFailed,
'.*Causality State is not "Solved"*'):
self.getPortal().portal_workflow.doActionFor(
packing_list, 'set_ready_action')
def stepCheckDeliveryRuleNotAppliedOnPackingListEdit(self,
sequence=None, sequence_list=None, **kw):
"""If we call edit on the packing list, delivery rule should not be
......@@ -2741,6 +2762,12 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
base_sequence +
"""
stepEditPackingListLine
stepTic
stepCheckPackingListIsDiverged
stepAssertCausalityStateIsNotSolvedInConsistencyMessage
stepSetReadyWorkflowTransitionIsBlockByConsistency
stepAcceptDecisionDescriptionPackingList
stepTic
stepSetReadyPackingList
stepTic
stepStartPackingList
......
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