Changeset 8981 for main/waeup.futminna/trunk/src/waeup/futminna
- Timestamp:
- 12 Jul 2012, 08:53:27 (12 years ago)
- Location:
- main/waeup.futminna/trunk/src/waeup/futminna
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.futminna/trunk/src/waeup/futminna
- Property svn:mergeinfo changed
/main/waeup.fceokene/trunk/src/waeup/fceokene merged: 8979 /main/waeup.uniben/trunk/src/waeup/uniben merged: 8959
- Property svn:mergeinfo changed
-
main/waeup.futminna/trunk/src/waeup/futminna/applicants/interfaces.py
r8932 r8981 33 33 INigeriaUGApplicant, INigeriaPGApplicant, 34 34 INigeriaApplicantOnlinePayment, 35 INigeriaUGApplicantEdit, INigeriaPGApplicantEdit, 36 INigeriaApplicantUpdateByRegNo, 37 IPUTMEApplicantEdit, 35 38 UG_OMIT_DISPLAY_FIELDS, 36 39 UG_OMIT_PDF_FIELDS, … … 82 85 """ 83 86 84 class ICustomUGApplicantEdit(I CustomUGApplicant):87 class ICustomUGApplicantEdit(INigeriaUGApplicantEdit): 85 88 """An undergraduate applicant interface for edit forms. 86 89 … … 94 97 """ 95 98 96 email = schema.ASCIILine( 97 title = _(u'Email Address'), 98 required = True, 99 constraint=validate_email, 100 ) 101 date_of_birth = FormattedDate( 102 title = _(u'Date of Birth'), 103 required = True, 104 show_year = True, 105 ) 106 107 ICustomUGApplicantEdit[ 108 'date_of_birth'].order = ICustomUGApplicant['date_of_birth'].order 109 ICustomUGApplicantEdit[ 110 'email'].order = ICustomUGApplicant['email'].order 111 112 class ICustomPGApplicantEdit(ICustomPGApplicant): 99 class ICustomPGApplicantEdit(INigeriaPGApplicantEdit): 113 100 """A postgraduate applicant interface for editing. 114 101 … … 122 109 """ 123 110 124 email = schema.ASCIILine(125 title = _(u'Email Address'),126 required = True,127 constraint=validate_email,128 )129 date_of_birth = FormattedDate(130 title = _(u'Date of Birth'),131 required = True,132 show_year = True,133 )134 135 ICustomPGApplicantEdit[136 'date_of_birth'].order = ICustomPGApplicant['date_of_birth'].order137 ICustomPGApplicantEdit[138 'email'].order = ICustomPGApplicant['email'].order139 140 111 class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment): 141 112 """An applicant payment via payment gateways. … … 143 114 """ 144 115 145 class IPUTMEApplicantEdit(I CustomUGApplicant):116 class IPUTMEApplicantEdit(IPUTMEApplicantEdit): 146 117 """An undergraduate applicant interface for editing. 147 118 … … 154 125 respective form page. 155 126 """ 156 email = schema.ASCIILine(157 title = _(u'Email Address'),158 required = True,159 constraint=validate_email,160 )161 date_of_birth = FormattedDate(162 title = _(u'Date of Birth'),163 required = True,164 show_year = True,165 )166 127 167 IPUTMEApplicantEdit[ 168 'date_of_birth'].order = ICustomUGApplicant['date_of_birth'].order 169 IPUTMEApplicantEdit[ 170 'email'].order = ICustomUGApplicant['email'].order 171 172 class ICustomApplicantUpdateByRegNo(ICustomApplicant): 128 class ICustomApplicantUpdateByRegNo(INigeriaApplicantUpdateByRegNo): 173 129 """Representation of an applicant. 174 130 … … 176 132 the applicant object. 177 133 """ 178 reg_number = schema.TextLine( 179 title = u'Registration Number', 180 required = False, 181 ) 134 -
main/waeup.futminna/trunk/src/waeup/futminna/students/tests/test_browser.py
r8907 r8981 152 152 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 153 153 self.browser.getControl("Create ticket").click() 154 self.assertMatches('...Session configuration object is not...', 155 self.browser.contents) 156 # Uups, we forgot to add a session configuration for next session 157 configuration = createObject('waeup.SessionConfiguration') 158 configuration.academic_session = 2005 159 self.app['configuration'].addSessionConfiguration(configuration) 160 self.browser.open(self.payments_path + '/addop') 161 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 162 self.browser.getControl("Create ticket").click() 154 163 self.assertMatches('...ticket created...', 155 164 self.browser.contents) … … 188 197 utils = getUtility(IStudentsUtils) 189 198 199 configuration = createObject('waeup.SessionConfiguration') 200 configuration.academic_session = 2005 201 self.app['configuration'].addSessionConfiguration(configuration) 202 190 203 error, payment = utils.setPaymentDetails('schoolfee',self.student) 191 204 self.assertEqual(payment, None) … … 200 213 self.assertEqual(error, None) 201 214 202 # Add penalty fee. 215 # Add penalty fee ... 216 # ... for cleared 203 217 self.app['configuration']['2004'].penalty_ug = 99.0 218 # ... for returning 219 self.app['configuration']['2005'].penalty_ug = 88.0 204 220 error, payment = utils.setPaymentDetails('schoolfee',self.student) 205 221 self.assertEqual(payment.amount_auth, 40099.0) … … 209 225 self.assertEqual(payment.p_level, 200) 210 226 self.assertEqual(payment.p_session, 2005) 211 self.assertEqual(payment.amount_auth, 200 99.0)227 self.assertEqual(payment.amount_auth, 20088.0) 212 228 self.assertEqual(payment.p_item, u'CERT1') 213 229 self.assertEqual(error, None) -
main/waeup.futminna/trunk/src/waeup/futminna/students/utils.py
r8952 r8981 97 97 p_session, p_level = self.getReturningData(student) 98 98 amount = getattr(certificate, 'school_fee_2', 0.0) 99 try: 100 academic_session = grok.getSite()[ 101 'configuration'][str(p_session)] 102 except KeyError: 103 return _(u'Session configuration object is not available.'), None 99 104 elif student.is_postgrad and student.state == PAID: 100 105 # Returning postgraduate students also pay for the next session … … 102 107 p_session += 1 103 108 amount = getattr(certificate, 'school_fee_2', 0.0) 109 try: 110 academic_session = grok.getSite()[ 111 'configuration'][str(p_session)] 112 except KeyError: 113 return _(u'Session configuration object is not available.'), None 104 114 if amount in (0.0, None): 105 115 return _(u'Amount could not be determined.'), None
Note: See TracChangeset for help on using the changeset viewer.