Changeset 8282 for main/waeup.kofa/trunk
- Timestamp:
- 26 Apr 2012, 08:05:13 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py
r8039 r8282 54 54 55 55 @property 56 def state(self):56 def app_state(self): 57 57 return IWorkflowState(self).getState() 58 58 59 59 @property 60 60 def translated_state(self): 61 return application_states_dict[self. state]61 return application_states_dict[self.app_state] 62 62 63 63 @property … … 84 84 """ 85 85 # Is applicant in the correct state? 86 if self. state != 'admitted':86 if self.app_state != 'admitted': 87 87 return False, "Applicant has not yet been admitted." 88 88 # Does registration number exist? -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r8280 r8282 759 759 @property 760 760 def display_actions(self): 761 state = IWorkflowState(self.context).getState()762 if state == INITIALIZED:761 app_state = IWorkflowState(self.context).getState() 762 if app_state == INITIALIZED: 763 763 actions = [[],[]] 764 elif state == STARTED:764 elif app_state == STARTED: 765 765 actions = [[_('Save')], 766 766 [_('Add online payment ticket'),_('Remove selected tickets')]] 767 elif state == PAID:767 elif app_state == PAID: 768 768 actions = [[_('Save'), _('Final Submit')], 769 769 [_('Remove selected tickets')]] … … 773 773 774 774 def unremovable(self, ticket): 775 state = IWorkflowState(self.context).getState()776 return ticket.r_code or state in (INITIALIZED, SUBMITTED)775 app_state = IWorkflowState(self.context).getState() 776 return ticket.r_code or app_state in (INITIALIZED, SUBMITTED) 777 777 778 778 def emit_lock_message(self): … … 826 826 return 827 827 self.applyData(self.context, **data) 828 state = IWorkflowState(self.context).getState()828 app_state = IWorkflowState(self.context).getState() 829 829 # This shouldn't happen, but the application officer 830 830 # might have forgotten to lock the form after changing the state 831 if state != PAID:831 if app_state != PAID: 832 832 self.flash(_('This form cannot be submitted. Wrong state!')) 833 833 return -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py
r8245 r8282 306 306 307 307 history = Attribute('Object history, a list of messages') 308 state = Attribute('The application state of an applicant')308 app_state = Attribute('The application state of an applicant') 309 309 display_fullname = Attribute('The fullname of an applicant') 310 310 application_date = Attribute('Date of submission, used for export only') -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/pdf.py
r8257 r8282 81 81 82 82 def _addComments(self, data): 83 if self.context. state == 'created':83 if self.context.app_state == 'created': 84 84 comment1 = _( 85 85 'Proceed to the login page of the portal' + -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r8280 r8282 662 662 self.assertMatches('...paid...', 663 663 self.browser.contents) 664 state = IWorkflowState(self.applicant).getState()665 self.assertTrue( state == 'paid')664 app_state = IWorkflowState(self.applicant).getState() 665 self.assertTrue(app_state == 'paid') 666 666 667 667 def test_final_submit(self): -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py
r8200 r8282 141 141 # into two parts. 142 142 self.assertTrue( 143 'app licant_id,application_date,application_number,course1,course2,'143 'app_state,applicant_id,application_date,application_number,course1,course2,' 144 144 'course_admitted,date_of_birth,display_fullname,email,firstname,' 145 145 'history,lastname,locked,middlename,notice,password,phone,' 146 'reg_number,screening_score,screening_venue,sex, state,'146 'reg_number,screening_score,screening_venue,sex,' 147 147 'student_id\r\n' 148 ' dp2011_654321,,654321,,,,,Anna Tester,,Anna,'148 'initialized,dp2011_654321,,654321,,,,,Anna Tester,,Anna,' 149 149 in result) 150 150 self.assertTrue( 151 151 'Application initialized by system\'],Tester,' 152 '0,,,,,,,,, initialized,\r\n'152 '0,,,,,,,,,\r\n' 153 153 in result) 154 154 return … … 164 164 # history dict. We skip the date and split the comparison 165 165 # into two parts. 166 self.assertTrue( 167 'applicant_id,application_date,application_number,course1,course2,' 166 print result 167 self.assertTrue( 168 'app_state,applicant_id,application_date,application_number,course1,course2,' 168 169 'course_admitted,date_of_birth,display_fullname,email,firstname,' 169 170 'history,lastname,locked,middlename,notice,password,phone,' 170 'reg_number,screening_score,screening_venue,sex, state,'171 'reg_number,screening_score,screening_venue,sex,' 171 172 'student_id\r\n' 172 ' dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04,'173 'initialized,dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04,' 173 174 'Anna M. Tester,anna@sample.com,Anna,' 174 175 in result) … … 176 177 'Application initialized by system\'],' 177 178 'Tester,0,M.,"Some notice\nin lines.",any password,' 178 '+234-123-12345,123456,98,Exam Room,f, initialized,\r\n'179 '+234-123-12345,123456,98,Exam Room,f,\r\n' 179 180 in result) 180 181 … … 189 190 result = open(self.outfile, 'rb').read() 190 191 self.assertTrue( 191 'app licant_id,application_date,application_number,course1,course2,'192 'app_state,applicant_id,application_date,application_number,course1,course2,' 192 193 'course_admitted,date_of_birth,display_fullname,email,firstname,' 193 194 'history,lastname,locked,middlename,notice,password,phone,' 194 'reg_number,screening_score,screening_venue,sex, state,'195 'reg_number,screening_score,screening_venue,sex,' 195 196 'student_id\r\n' 196 ' dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04,'197 'initialized,dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04,' 197 198 'Anna M. Tester,anna@sample.com,Anna,' 198 199 in result) … … 200 201 'Application initialized by system\'],' 201 202 'Tester,0,M.,"Some notice\nin lines.",any password,' 202 '+234-123-12345,123456,98,Exam Room,f, initialized,\r\n'203 in result) 204 return 203 '+234-123-12345,123456,98,Exam Room,f,\r\n' 204 in result) 205 return
Note: See TracChangeset for help on using the changeset viewer.