Changeset 8666 for main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Timestamp:
- 10 Jun 2012, 20:13:34 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r8665 r8666 711 711 prefix = 'form' 712 712 713 def update(self): 714 if self.context.state in ('initialized', 'started'): 715 self.flash( 716 _('Please pay before trying to download the application slip.')) 717 return self.redirect(self.url(self.context)) 718 return 719 713 720 def render(self): 714 721 pdfstream = getAdapter(self.context, IPDF, name='application_slip')( -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r8665 r8666 460 460 self.browser.getControl("Save").click() 461 461 self.assertMatches('...Form has been saved...', self.browser.contents) 462 # Open pdf slip 462 # Pdf slip can't be opened and download button is not available 463 self.assertFalse('Download application slip' in self.browser.contents) 463 464 self.browser.open(self.slip_path) 465 self.assertTrue( 466 'Please pay before trying to download the application slip.' 467 in self.browser.contents) 468 # If applicant is in correct state the pdf slip can be opened. 469 IWorkflowState(self.applicant).setState('paid') 470 self.browser.open(self.manage_path) 471 self.browser.getLink("Download application slip").click() 464 472 self.assertEqual(self.browser.headers['Status'], '200 Ok') 465 473 self.assertEqual(self.browser.headers['Content-Type'], … … 743 751 self.assertMatches('...started...', 744 752 self.browser.contents) 745 state = IWorkflowState(self.applicant).getState() 746 self.assertTrue(state == 'started') 753 self.assertTrue(self.applicant.state == 'started') 747 754 # Let's logout and approve the payment as manager 748 755 self.browser.getLink("Logout").click() … … 759 766 self.assertEqual(payment.r_amount_approved, 200.0) 760 767 self.assertEqual(payment.r_code, 'AP') 761 state = IWorkflowState(self.applicant).getState() 762 self.assertTrue(state == 'paid') 768 self.assertTrue(self.applicant.state == 'paid') 763 769 return 764 770 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/viewlets.py
r8665 r8666 17 17 ## 18 18 import grok 19 from hurry.workflow.interfaces import IWorkflowState20 19 from waeup.kofa.interfaces import IKofaObject 21 20 from waeup.kofa.students.viewlets import PrimaryStudentNavTab … … 171 170 target = 'application_slip.pdf' 172 171 172 @property 173 def target_url(self): 174 """Get a URL to the target... 175 """ 176 if self.context.state in ('initialized', 'started'): 177 return 178 return self.view.url(self.view.context, self.target) 179 173 180 class StudentCreateActionButton(ManageActionButton): 174 181 grok.order(4) … … 183 190 """Get a URL to the target... 184 191 """ 185 if IWorkflowState(self.context).getState()!= 'admitted':192 if self.context.state != 'admitted': 186 193 return 187 194 return self.view.url(self.view.context, self.target)
Note: See TracChangeset for help on using the changeset viewer.