Changeset 12145 for main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests
- Timestamp:
- 4 Dec 2014, 18:11:12 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12119 r12145 31 31 from zope.component import createObject, queryUtility, getUtility 32 32 from zope.component.hooks import setSite, clearSite 33 from zope.schema.interfaces import ConstraintNotSatisfied 33 34 from zope.catalog.interfaces import ICatalog 34 35 from zope.security.interfaces import Unauthorized 35 36 from zope.securitypolicy.interfaces import IPrincipalRoleManager 36 37 from zope.testbrowser.testing import Browser 37 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 38 from hurry.workflow.interfaces import ( 39 IWorkflowInfo, IWorkflowState, InvalidTransitionError) 38 40 from waeup.ikoba.testing import FunctionalLayer, FunctionalTestCase 39 41 from waeup.ikoba.app import Company … … 1209 1211 print "Sample contract_slip.pdf written to %s" % path 1210 1212 1213 def test_contract_approval(self): 1214 # This is not a UI test. It just tests the approval 1215 # of contracts. 1216 self.assertRaises(ConstraintNotSatisfied, 1217 self.contract.document_object, self.document) 1218 # Document must be at least submitted 1219 IWorkflowState(self.document).setState('submitted') 1220 self.contract.document_object = self.document 1221 IWorkflowState(self.contract).setState('submitted') 1222 self.assertRaises(InvalidTransitionError, 1223 IWorkflowInfo(self.contract).fireTransition, 'approve') 1224 # Document must be verified for the approval of contracts 1225 IWorkflowState(self.document).setState('verified') 1226 IWorkflowInfo(self.contract).fireTransition('approve') 1227 self.assertEqual(IWorkflowState(self.contract).getState(), 'approved') 1228 return 1229
Note: See TracChangeset for help on using the changeset viewer.