Changeset 16264 for main/kofacustom.iuokada/trunk/src/kofacustom
- Timestamp:
- 5 Oct 2020, 06:25:25 (4 years ago)
- Location:
- main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser.py
r16263 r16264 132 132 self.redirect(self.url(self.context)) 133 133 return 134 minamount = 200000 135 if not self.context.minimumFreshStudentPayments(minamount): 136 self.flash('Please make required payments first ' 137 '(at least in the amount of %s Naira).' % minamount, 138 type="warning") 139 self.redirect(self.url(self.context, 'view_personal')) 140 return 134 141 super(CustomStudentPersonalEditFormPage, self).update() 135 142 return -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/student.py
r16249 r16264 51 51 return False 52 52 53 def minimumFreshStudentPayments(self, minamount): 54 """Neede to access edit_personal. Only in iuokada package. 55 """ 56 if not self.is_fresh: 57 return False 58 total_amount = 0.0 59 for ticket in self['payments'].values(): 60 if ticket.p_state == 'paid': 61 total_amount += ticket.amount_auth 62 if total_amount > minamount: 63 return True 64 return False 65 66 @property 67 def personal_data_expired(self): 68 # This reqirement is not compatible with minimumFreshStudentPayments. 69 return False 70 53 71 54 72 # Set all attributes of Student required in IStudent as field -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/tests/test_browser.py
r16263 r16264 110 110 self.browser.getControl(name="form.password").value = 'spwd' 111 111 self.browser.getControl("Login").click() 112 self.assertFalse(' Library' in self.browser.contents)112 self.assertFalse('Download Library' in self.browser.contents) 113 113 self.student.library = True 114 114 self.browser.open(self.student_path) … … 138 138 open(path, 'wb').write(self.browser.contents) 139 139 print "Sample PDF studycourse_slip.pdf written to %s" % path 140 141 def test_student_personal_edit(self): 142 IWorkflowState(self.student).setState('school fee paid') 143 self.browser.open(self.login_path) 144 self.browser.getControl(name="form.login").value = self.student_id 145 self.browser.getControl(name="form.password").value = 'spwd' 146 self.browser.getControl("Login").click() 147 self.browser.getLink("Bio Data").click() 148 self.browser.getLink("Edit registration bio data").click() 149 self.assertTrue("Please make required payments first" in self.browser.contents) 150 self.assertEqual(self.browser.url, self.personal_path) 140 151 141 152 def test_student_personal_slip(self):
Note: See TracChangeset for help on using the changeset viewer.