Changeset 12169


Ignore:
Timestamp:
8 Dec 2014, 07:14:15 (10 years ago)
Author:
Henrik Bettermann
Message:

Define is_verifiable as probably requested. Adjust test.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba/customers
Files:
3 edited

Legend:

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

    r12167 r12169  
    932932            transition_id = form['transition']
    933933            wf_info = IWorkflowInfo(self.context)
    934             wf_info.fireTransition(transition_id)
     934            try:
     935                wf_info.fireTransition(transition_id)
     936            except InvalidTransitionError, error:
     937                self.flash(error, type="warning")
    935938        return
    936939
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/documents.py

    r12168 r12169  
    143143    @property
    144144    def is_verifiable(self):
     145        files = self.connected_files
     146        if files is not None and len(files) != len(self.filenames):
     147            return False, _("No file uploaded.")
    145148        return True, None
    146149
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py

    r12166 r12169  
    849849        self.browser.getControl(name="transition").value = ['submit']
    850850        self.browser.getControl("Save").click()
     851        # Document can only be verified if files have been uploaded before
    851852        self.browser.getControl(name="transition").value = ['verify']
    852853        self.browser.getControl("Save").click()
    853         self.assertEqual(document.state, 'verified')
     854        self.assertTrue('No file uploaded' in self.browser.contents)
     855        self.assertEqual(document.state, 'submitted')
     856        # We set state here manually (verification is tested in test_verify_document)
     857        IWorkflowState(document).setState(VERIFIED)
    854858
    855859        # Manage button and form is no longer available
Note: See TracChangeset for help on using the changeset viewer.