Ignore:
Timestamp:
5 Dec 2014, 15:43:24 (10 years ago)
Author:
Henrik Bettermann
Message:

Catch InvalidTransitionError? in UI.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py

    r12145 r12151  
    12261226        IWorkflowInfo(self.contract).fireTransition('approve')
    12271227        self.assertEqual(IWorkflowState(self.contract).getState(), 'approved')
    1228         return
    1229 
     1228
     1229
     1230    def test_contract_approval_in_UI(self):
     1231        # Now let's see what the UI says why trying to approve a contract
     1232        # with unverified documents.
     1233        IWorkflowState(self.document).setState('submitted')
     1234        self.contract.document_object = self.document
     1235        IWorkflowState(self.contract).setState('submitted')
     1236        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     1237        self.browser.open(self.contracts_path + '/c101/trigtrans')
     1238        self.browser.getControl(name="transition").value = ['approve']
     1239        self.browser.getControl("Save").click()
     1240        # InvalidTransitionError is catched
     1241        self.assertTrue(
     1242            '<div class="alert alert-warning">Attached documents must be verified first.</div>'
     1243            in self.browser.contents)
     1244        IWorkflowState(self.document).setState('verified')
     1245        self.browser.getControl(name="transition").value = ['approve']
     1246        self.browser.getControl("Save").click()
     1247        self.assertEqual(IWorkflowState(self.contract).getState(), 'approved')
Note: See TracChangeset for help on using the changeset viewer.