Changeset 9525 for main/waeup.fceokene/trunk/src/waeup/fceokene
- Timestamp:
- 4 Nov 2012, 19:54:18 (12 years ago)
- Location:
- main/waeup.fceokene/trunk/src/waeup/fceokene/students
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_browser.py
r9434 r9525 93 93 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 94 94 self.browser.open(self.payments_path) 95 self.browser.get Control("Add onlinepayment ticket").click()95 self.browser.getLink("Add current session payment ticket").click() 96 96 self.browser.getControl("Create ticket").click() 97 97 self.assertMatches('...Amount could not be determined...', … … 164 164 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 165 165 self.browser.getControl("Create ticket").click() 166 self.assertMatches('...ticket created...', 167 self.browser.contents) 166 # Uups, we forgot to add a session configuration for next session 167 self.assertTrue('Session configuration object is not available.' 168 in self.browser.contents) 169 configuration = createObject('waeup.SessionConfiguration') 170 configuration.academic_session = 2005 171 self.app['configuration'].addSessionConfiguration(configuration) 172 self.browser.getControl("Create ticket").click() 173 self.assertMatches('...ticket created...', 174 self.browser.contents) 175 168 176 # In state admitted school fee can't be determined 169 177 IWorkflowState(self.student).setState('admitted') … … 174 182 self.browser.contents) 175 183 176 # If the session configuration doesn't exist an error message will 177 # be shown. No other requirement is being checked. 178 del self.app['configuration']['2004'] 179 self.browser.open(self.payments_path) 180 self.browser.getControl("Add online payment ticket").click() 181 self.browser.getControl("Create ticket").click() 182 self.assertMatches('...Session configuration object is not...', 183 self.browser.contents) 184 def test_student_payments(self): 185 # Login 186 IWorkflowState(self.student).setState('returning') 187 self.browser.open(self.login_path) 188 self.browser.getControl(name="form.login").value = self.student_id 189 self.browser.getControl(name="form.password").value = 'spwd' 190 self.browser.getControl("Login").click() 191 self.browser.open(self.student_path + '/payments') 192 self.assertTrue( 193 'Add current session payment ticket' in self.browser.contents) 194 self.assertFalse( 195 'Add previous session payment ticket' in self.browser.contents) 196 return 184 197 185 198 def test_get_returning_data(self): … … 214 227 215 228 IWorkflowState(self.student).setState('returning') 229 error, payment = utils.setPaymentDetails('schoolfee',self.student) 230 self.assertEqual('Session configuration object is not available.', error) 231 configuration = createObject('waeup.SessionConfiguration') 232 configuration.academic_session = 2005 233 self.app['configuration'].addSessionConfiguration(configuration) 216 234 error, payment = utils.setPaymentDetails('schoolfee',self.student) 217 235 self.assertEqual(payment.p_level, 200) -
main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py
r9297 r9525 71 71 p_level = student['studycourse'].current_level 72 72 p_current = True 73 session = str(p_session) 74 try: 75 academic_session = grok.getSite()['configuration'][session] 76 except KeyError: 73 academic_session = self._getSessionConfiguration(p_session) 74 if academic_session == None: 77 75 return _(u'Session configuration object is not available.'), None 76 # Determine fee. 78 77 if category == 'transfer': 79 78 amount = academic_session.transfer_fee … … 202 201 amount = 17400 203 202 if student.state == RETURNING: 203 # Override p_session and p_level 204 204 p_session, p_level = self.getReturningData(student) 205 academic_session = self._getSessionConfiguration(p_session) 206 if academic_session == None: 207 return _(u'Session configuration object is not available.'), None 205 208 206 209 if amount in (0.0, None):
Note: See TracChangeset for help on using the changeset viewer.