Changeset 8528 for main/waeup.fceokene
- Timestamp:
- 26 May 2012, 10:46:13 (13 years ago)
- Location:
- main/waeup.fceokene/trunk/src/waeup/fceokene
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/browser.py
r8520 r8528 153 153 factory = u'waeup.CustomApplicantOnlinePayment' 154 154 155 def _fillCustomFields(self, payment, session_config):156 # No custom fields at the moment157 return payment158 159 155 class CustomExportPDFPaymentSlipPage(ExportPDFPaymentSlipPage): 160 156 """Deliver a PDF slip of the context. -
main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/tests.py
r8520 r8528 30 30 from waeup.kofa.university.department import Department 31 31 from waeup.kofa.testing import FunctionalTestCase 32 from waeup.kofa.configuration import SessionConfiguration 32 33 from waeup.kofa.applicants.container import ApplicantsContainer 33 34 from waeup.kofa.applicants.tests.test_batching import ApplicantImportExportSetup … … 63 64 self.pgcontainer.code = u'pgft2011' 64 65 self.pgcontainer.prefix = u'pgft' 66 self.pgcontainer.year = 2011 67 self.pgcontainer.application_fee = 300.0 68 self.pgcontainer.title = u'This is the pgft2011 container' 65 69 self.app['applicants']['pgft2011'] = self.pgcontainer 66 70 self.ugcontainer = ApplicantsContainer() 67 self.ugcontainer.code = u'app2011' 68 self.ugcontainer.prefix = u'app' 71 self.ugcontainer.code = u'putme2011' 72 self.ugcontainer.prefix = u'putme' 73 self.ugcontainer.year = 2011 74 self.ugcontainer.application_fee = 200.0 75 self.ugcontainer.title = u'This is the app2011 container' 69 76 self.app['applicants']['app2011'] = self.ugcontainer 70 77 … … 96 103 self.ugapplicant = self.app['applicants']['app2011'][ 97 104 self.ugapplication_number] 105 self.pgapplicant_path = ('http://localhost/app/applicants/pgft2011/%s' 106 % self.pgapplication_number) 107 self.ugapplicant_path = ('http://localhost/app/applicants/app2011/%s' 108 % self.ugapplication_number) 98 109 99 110 self.browser = Browser() … … 106 117 return 107 118 108 def test_manage_and_view_applicant(self): 109 # Managers can manage pg applicants 110 pgapplicant_path = ('http://localhost/app/applicants/pgft2011/%s' 111 % self.pgapplication_number) 112 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 113 # The IPGApplicant interface is really used in all pages 114 self.browser.open(pgapplicant_path) 115 self.assertEqual(self.browser.headers['Status'], '200 Ok') 116 self.assertTrue('Employer' in self.browser.contents) 117 self.browser.open(pgapplicant_path + '/manage') 118 self.assertEqual(self.browser.headers['Status'], '200 Ok') 119 self.assertTrue('Employer' in self.browser.contents) 120 self.browser.open(pgapplicant_path + '/edit') 121 self.assertEqual(self.browser.headers['Status'], '200 Ok') 122 self.assertTrue('Employer' in self.browser.contents) 123 self.browser.open(pgapplicant_path + '/application_slip.pdf') 124 self.assertEqual(self.browser.headers['Status'], '200 Ok') 125 # If we view the applicant in the ug container, 126 # the employer field doesn't appear 127 ugapplicant_path = ('http://localhost/app/applicants/app2011/%s' 128 % self.ugapplication_number) 129 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 130 self.browser.open(ugapplicant_path) 131 self.assertEqual(self.browser.headers['Status'], '200 Ok') 132 self.assertFalse('Employer' in self.browser.contents) 133 self.browser.open(ugapplicant_path + '/manage') 134 self.assertEqual(self.browser.headers['Status'], '200 Ok') 135 # We can save the applicant 119 def fill_correct_values(self): 136 120 self.browser.getControl(name="form.reg_number").value = '1234' 137 121 self.browser.getControl(name="form.firstname").value = 'John' … … 142 126 self.browser.getControl(name="form.sex").value = ['m'] 143 127 self.browser.getControl(name="form.email").value = 'xx@yy.zz' 128 129 def test_manage_and_view_applicant(self): 130 # Managers can manage pg applicants 131 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 132 # The IPGApplicant interface is really used in all pages 133 self.browser.open(self.pgapplicant_path) 134 self.assertEqual(self.browser.headers['Status'], '200 Ok') 135 self.assertTrue('Employer' in self.browser.contents) 136 self.browser.open(self.pgapplicant_path + '/manage') 137 self.assertEqual(self.browser.headers['Status'], '200 Ok') 138 self.assertTrue('Employer' in self.browser.contents) 139 self.browser.open(self.pgapplicant_path + '/edit') 140 self.assertEqual(self.browser.headers['Status'], '200 Ok') 141 self.assertTrue('Employer' in self.browser.contents) 142 self.browser.open(self.pgapplicant_path + '/application_slip.pdf') 143 self.assertEqual(self.browser.headers['Status'], '200 Ok') 144 # If we view the applicant in the ug container, 145 # the employer field doesn't appear 146 self.browser.open(self.ugapplicant_path) 147 self.assertEqual(self.browser.headers['Status'], '200 Ok') 148 self.assertFalse('Employer' in self.browser.contents) 149 self.browser.open(self.ugapplicant_path + '/manage') 150 self.assertEqual(self.browser.headers['Status'], '200 Ok') 151 # We can save the applicant 152 self.fill_correct_values() 144 153 self.browser.getControl("Save").click() 145 154 self.assertMatches('...Form has been saved...', self.browser.contents) 146 155 self.assertFalse('Employer' in self.browser.contents) 147 self.browser.open( ugapplicant_path + '/edit')156 self.browser.open(self.ugapplicant_path + '/edit') 148 157 self.assertEqual(self.browser.headers['Status'], '200 Ok') 149 158 self.assertFalse('Employer' in self.browser.contents) 150 self.browser.open(ugapplicant_path + '/application_slip.pdf') 151 self.assertEqual(self.browser.headers['Status'], '200 Ok') 159 self.browser.open(self.ugapplicant_path + '/application_slip.pdf') 160 self.assertEqual(self.browser.headers['Status'], '200 Ok') 161 return 162 163 def test_application_payment(self): 164 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 165 166 # UG (UTME) applicant 167 self.browser.open(self.ugapplicant_path) 168 self.browser.open(self.ugapplicant_path + '/manage') 169 self.assertEqual(self.browser.headers['Status'], '200 Ok') 170 self.fill_correct_values() 171 self.browser.getControl("Save").click() 172 self.assertMatches('...Form has been saved...', self.browser.contents) 173 self.fill_correct_values() 174 self.browser.getControl("Save").click() 175 self.browser.getControl("Add online payment ticket").click() 176 self.assertMatches('...Payment ticket created...', 177 self.browser.contents) 178 self.assertMatches('...Amount Authorized...', 179 self.browser.contents) 180 payment_id = self.ugapplicant.keys()[0] 181 payment = self.ugapplicant[payment_id] 182 self.assertEqual(payment.p_item,'This is the app2011 container') 183 self.assertEqual(payment.p_session,2011) 184 self.assertEqual(payment.p_category,'application') 185 self.assertEqual(payment.amount_auth, 200.0) 186 187 # PG applicants pay more 188 self.browser.open(self.pgapplicant_path) 189 self.browser.open(self.pgapplicant_path + '/manage') 190 self.assertEqual(self.browser.headers['Status'], '200 Ok') 191 self.fill_correct_values() 192 self.browser.getControl(name="form.reg_number").value = '2345' 193 self.browser.getControl(name="form.firstname").value = 'Anna' 194 self.browser.getControl("Save").click() 195 self.assertMatches('...Form has been saved...', self.browser.contents) 196 self.browser.getControl("Add online payment ticket").click() 197 self.assertMatches('...Payment ticket created...', 198 self.browser.contents) 199 self.assertMatches('...Amount Authorized...', 200 self.browser.contents) 201 payment_id = self.pgapplicant.keys()[0] 202 payment = self.pgapplicant[payment_id] 203 self.assertEqual(payment.p_item,'This is the pgft2011 container') 204 self.assertEqual(payment.p_session,2011) 205 self.assertEqual(payment.p_category,'application') 206 self.assertEqual(payment.amount_auth, 300.0) 152 207 return 153 208 -
main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/utils.py
r8460 r8528 19 19 """ 20 20 21 from time import time 21 22 import sys 22 23 import grok … … 35 36 'sandwich': ['Part Time Degree in Education', 'SAND'], 36 37 'pt': ['Part-Time Degree Programmes', 'PTP'], 37 'pu me': ['Post UME Screening Test', 'PUME'],38 'putme': ['Post UTME Screening Test', 'PUTME'], 38 39 'app': ['General Studies', 'APP'], 39 40 'cest': ['Common Entry Screening Test', 'CEST'], … … 56 57 'form.presently_inst': _(u'Presently attending a course or programme'), 57 58 } 59 60 def setPaymentDetails(self, container, payment): 61 """Set the payment data of an applicant. 62 """ 63 timestamp = "%d" % int(time()*1000) 64 payment.p_id = "p%s" % timestamp 65 payment.p_item = container.title 66 payment.p_session = container.year 67 payment.p_category = 'application' 68 # We are using the container specific application fee 69 # instead of the session configuration application fee. 70 payment.amount_auth = container.application_fee 71 return None -
main/waeup.fceokene/trunk/src/waeup/fceokene/interfaces.py
r8504 r8528 102 102 103 103 application_fee = schema.Float( 104 title = _(u'Application Fee '),104 title = _(u'Application Fee (ignored)'), 105 105 default = 0.0, 106 106 required = False, -
main/waeup.fceokene/trunk/src/waeup/fceokene/interswitch/tests.py
r8460 r8528 130 130 #IWorkflowState(self.student).setState('started') 131 131 super(InterswitchTestsApplicants, self).fill_correct_values() 132 self.applicantscontainer.application_fee = 1000.0 132 133 self.browser.getControl(name="transition").value = ['start'] 133 134 self.browser.getControl("Save").click() 134 self.browser.getControl("Add online").click()135 self.assertTrue(136 'Session configuration object is not available'137 in self.browser.contents)138 configuration = SessionConfiguration()139 configuration.academic_session = 2009140 configuration.application_fee = 1000.0141 self.app['configuration'].addSessionConfiguration(configuration)142 self.browser.open(self.manage_path)143 135 self.browser.getControl("Add online").click() 144 136 self.assertMatches('...ticket created...', -
main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py
r8475 r8528 149 149 150 150 # FCEOkene prefix 151 STUDENT_ID_PREFIX = u' O'151 STUDENT_ID_PREFIX = u'K' -
main/waeup.fceokene/trunk/src/waeup/fceokene/utils/utils.py
r8460 r8528 182 182 'pg_pt': 'Postgraduate Part Time', 183 183 'jm_ft': 'Joint Matriculation Full Time', 184 'u me_ft': 'UME Full Time',184 'utme_ft': 'UTME Full Time', 185 185 'de_ft': 'Direct Entry Full Time', 186 186 'ph_ft': 'Post Higher Education Full Time', … … 194 194 195 195 APP_CATS_DICT = { 196 'basic': 'PU ME, PDE, PCE, PRENCE',196 'basic': 'PUTME, PDE, PCE, PRENCE', 197 197 'no': 'no application', 198 198 'pg_ft': 'Postgraduate Full-Time',
Note: See TracChangeset for help on using the changeset viewer.