Changeset 15574
- Timestamp:
- 30 Aug 2019, 07:06:51 (5 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/students
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py
r15404 r15574 35 35 StudentActivateView, StudentDeactivateView, 36 36 ExportPDFTranscriptSlip, 37 PaymentsManageFormPage) 37 PaymentsManageFormPage, 38 StartClearancePage) 38 39 from waeup.kofa.students.workflow import (CREATED, ADMITTED, PAID, 39 40 CLEARANCE, REQUESTED, RETURNING, CLEARED, REGISTERED, VALIDATED, … … 95 96 'payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 96 97 98 class CustomStartClearancePage(StartClearancePage): 99 100 @property 101 def with_ac(self): 102 if self.context.faccode == 'DCOEM': 103 return False 104 return True 105 97 106 class CustomStudentClearanceEditFormPage(NigeriaStudentClearanceEditFormPage): 98 107 """ View to edit student clearance data by student -
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r15403 r15574 45 45 46 46 SAMPLE_FPM = os.path.join(os.path.dirname(__file__), 'sample.fpm') 47 SAMPLE_IMAGE = os.path.join(os.path.dirname(__file__), 'test_image.jpg') 47 48 48 49 class OfficerUITests(StudentsFullSetup): … … 1167 1168 self.assertEqual(self.student['payments'].values()[2].amount_auth, 987.0) 1168 1169 return 1170 1171 def test_student_clearance(self): 1172 # create some passport file for `student` 1173 storage = getUtility(IExtFileStore) 1174 image_path = os.path.join(os.path.dirname(__file__), 'test_image.jpg') 1175 self.image_contents = open(image_path, 'rb').read() 1176 file_id = IFileStoreNameChooser(self.student).chooseName( 1177 attr='passport.jpg') 1178 storage.createFile(file_id, StringIO(self.image_contents)) 1179 IWorkflowInfo(self.student).fireTransition('admit') 1180 self.browser.open(self.login_path) 1181 self.browser.getControl(name="form.login").value = self.student_id 1182 self.browser.getControl(name="form.password").value = 'spwd' 1183 self.browser.getControl("Login").click() 1184 self.assertMatches( 1185 '...You logged in...', self.browser.contents) 1186 self.browser.getLink("Base Data").click() 1187 self.browser.getLink("Download admission letter").click() 1188 self.assertEqual(self.browser.headers['Status'], '200 Ok') 1189 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 1190 path = os.path.join(samples_dir(), 'admission_slip.pdf') 1191 open(path, 'wb').write(self.browser.contents) 1192 print "Sample PDF admission_slip.pdf written to %s" % path 1193 self.browser.open(self.student_path + '/start_clearance') 1194 # Regular students have to enter an access code 1195 self.browser.getControl("Start clearance now").click() 1196 self.assertTrue('Activation code is invalid' in self.browser.contents) 1197 # DCOEM students can start clearance without access code 1198 self.app['faculties']['fac1'].code = 'DCOEM' 1199 self.browser.open(self.student_path + '/start_clearance') 1200 self.browser.getControl("Start clearance now").click() 1201 self.assertMatches('...Clearance process has been started...', 1202 self.browser.contents) -
main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py
r15482 r15574 300 300 # 'MBBSMED', 'MBBSNDU', 'BSCPTY', 'BSCPST'): 301 301 amount = 80000.0 302 elif student.faccode == 'DCOEM': 303 return _('Acceptance fee payment not necessary.'), None 302 304 else: 303 305 amount = 60000.0
Note: See TracChangeset for help on using the changeset viewer.