Changeset 12353 for main/waeup.ikoba/trunk/src/waeup/ikoba
- Timestamp:
- 31 Dec 2014, 16:09:01 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
r12351 r12353 429 429 dict(name=x, title=y) for x, y in allowed_transitions] 430 430 431 @action(_('Apply now'), style='primary')431 @action(_('Apply'), style='primary') 432 432 def apply(self, **data): 433 433 form = self.request.form … … 993 993 dict(name=x, title=y) for x, y in allowed_transitions] 994 994 995 @action(_('Apply now'), style='primary')995 @action(_('Apply'), style='primary') 996 996 def apply(self, **data): 997 997 form = self.request.form … … 1394 1394 dict(name=x, title=y) for x, y in allowed_transitions] 1395 1395 1396 @action(_('Apply now'), style='primary')1396 @action(_('Apply'), style='primary') 1397 1397 def apply(self, **data): 1398 1398 form = self.request.form -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12352 r12353 325 325 # Managers can trigger transitions 326 326 self.browser.getControl(name="transition").value = ['start'] 327 self.browser.getControl("Apply now").click()327 self.browser.getControl("Apply").click() 328 328 # Managers can edit base 329 329 self.browser.open(self.customer_path) … … 388 388 self.browser.open(self.trigtrans_path) 389 389 self.browser.getControl(name="transition").value = ['start'] 390 self.browser.getControl("Apply now").click()390 self.browser.getControl("Apply").click() 391 391 self.browser.open(self.trigtrans_path) 392 392 self.browser.getControl(name="transition").value = ['request'] 393 self.browser.getControl("Apply now").click()393 self.browser.getControl("Apply").click() 394 394 self.browser.open(self.trigtrans_path) 395 395 self.browser.getControl(name="transition").value = ['reject'] 396 self.browser.getControl("Apply now").click()396 self.browser.getControl("Apply").click() 397 397 self.browser.open(self.trigtrans_path) 398 398 self.browser.getControl(name="transition").value = ['request'] 399 self.browser.getControl("Apply now").click()399 self.browser.getControl("Apply").click() 400 400 self.browser.open(self.trigtrans_path) 401 401 self.browser.getControl(name="transition").value = ['approve'] 402 self.browser.getControl("Apply now").click()402 self.browser.getControl("Apply").click() 403 403 self.browser.open(self.trigtrans_path) 404 404 self.browser.getControl(name="transition").value = ['reset1'] 405 self.browser.getControl("Apply now").click()405 self.browser.getControl("Apply").click() 406 406 return 407 407 … … 837 837 # Managers can access the pages of customer documentsconter 838 838 # and can perform actions 839 IWorkflowState(self.customer).setState('approved')840 839 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 841 840 self.browser.open(self.customer_path) … … 865 864 self.browser.getLink("Transition").click() 866 865 self.browser.getControl(name="transition").value = ['submit'] 867 self.browser.getControl("Apply now").click()866 self.browser.getControl("Apply").click() 868 867 self.browser.getLink("Transition").click() 868 # Document can only be verified if customer is approved 869 self.browser.getControl(name="transition").value = ['verify'] 870 self.browser.getControl("Apply").click() 871 self.assertTrue('Customer has not yet been approved' in self.browser.contents) 872 IWorkflowState(self.customer).setState(APPROVED) 869 873 # Document can only be verified if files have been uploaded before 874 self.browser.getLink("Transition").click() 870 875 self.browser.getControl(name="transition").value = ['verify'] 871 self.browser.getControl("Apply now").click()876 self.browser.getControl("Apply").click() 872 877 self.assertTrue('No file uploaded' in self.browser.contents) 873 878 self.assertEqual(document.state, 'submitted') … … 1057 1062 self.browser.open(self.documents_path + '/DOC1/trigtrans') 1058 1063 self.browser.getControl(name="transition").value = ['verify'] 1059 self.browser.getControl("Apply now").click()1064 self.browser.getControl("Apply").click() 1060 1065 self.assertEqual( 1061 1066 getattr(self.document, 'sample_md5', None), … … 1191 1196 self.browser.getLink("Transition").click() 1192 1197 self.browser.getControl(name="transition").value = ['submit'] 1193 self.browser.getControl("Apply now").click()1198 self.browser.getControl("Apply").click() 1194 1199 self.browser.getLink("Transition").click() 1195 1200 self.browser.getControl(name="transition").value = ['approve'] 1196 self.browser.getControl("Apply now").click()1201 self.browser.getControl("Apply").click() 1197 1202 self.assertEqual(contract.state, 'approved') 1198 1203 … … 1318 1323 # Customer can submit the form. The form is also saved. 1319 1324 self.browser.getLink("Edit").click() 1320 self.browser.getControl("Apply now").click()1325 self.browser.getControl("Apply").click() 1321 1326 self.assertEqual(contract.state, 'submitted') 1322 1327 self.assertTrue('Contract State: submitted for approval' in self.browser.contents) … … 1375 1380 self.browser.open(self.contracts_path + '/CON1/trigtrans') 1376 1381 self.browser.getControl(name="transition").value = ['approve'] 1377 self.browser.getControl("Apply now").click()1382 self.browser.getControl("Apply").click() 1378 1383 # InvalidTransitionError is catched 1379 1384 self.assertTrue( … … 1383 1388 IWorkflowState(self.document).setState('verified') 1384 1389 self.browser.getControl(name="transition").value = ['approve'] 1385 self.browser.getControl("Apply now").click()1390 self.browser.getControl("Apply").click() 1386 1391 self.assertEqual(IWorkflowState(self.contract).getState(), 'approved')
Note: See TracChangeset for help on using the changeset viewer.