Changeset 16184 for main/waeup.uniben/trunk/src/waeup/uniben
- Timestamp:
- 28 Jul 2020, 10:19:11 (4 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py
r16178 r16184 623 623 @property 624 624 def form_fields(self): 625 if self.target == 'ictwk': 625 if self.target is not None and self.target == 'tscf': 626 form_fields = grok.AutoFields(ITranscriptApplicant) 627 for field in TRANS_OMIT_FIELDS: 628 form_fields = form_fields.omit(field) 629 elif self.target is not None and self.target == 'tscs': 630 form_fields = grok.AutoFields(ITranscriptApplicant) 631 for field in TRANS_SHORT_OMIT_FIELDS: 632 form_fields = form_fields.omit(field) 633 elif self.target is not None and self.target == 'ictwk': 626 634 form_fields = grok.AutoFields(IUnibenRegistration) 627 635 for field in REGISTRATION_OMIT_PDF_FIELDS: 628 636 form_fields = form_fields.omit(field) 629 return form_fields 630 if self.target is not None and self.target.startswith('pg'): 637 elif self.target is not None and self.target.startswith('pg'): 631 638 form_fields = grok.AutoFields(ICustomPGApplicant) 632 639 for field in PG_OMIT_PDF_FIELDS: -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/tests/test_browser.py
r16183 r16184 174 174 175 175 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 176 self.slip_path = self.view_path + '/application_slip.pdf'177 176 self.browser.open(self.manage_path) 178 177 self.assertEqual(self.browser.headers['Status'], '200 Ok') … … 294 293 print "Sample ictwk_application_slip.pdf written to %s" % path 295 294 296 def test_transcript_ payment(self):295 def test_transcript_application(self): 297 296 configuration = CustomSessionConfiguration() 298 297 configuration.academic_session = session_1 … … 308 307 applicantscontainer.mode = 'create' 309 308 applicantscontainer.strict_deadline = True 310 applicantscontainer.with_picture = False309 applicantscontainer.with_picture = True 311 310 delta = datetime.timedelta(days=10) 312 311 applicantscontainer.startdate = datetime.datetime.now(pytz.utc) - delta … … 337 336 self.browser.getControl(name="form.course_studied").value = ['CERT1'] 338 337 self.browser.getControl(name="form.matric_number").value = '234' 339 self.browser.getControl(name="form.dispatch_address").value = 'Kuensche '338 self.browser.getControl(name="form.dispatch_address").value = 'Kuensche\nMarsch 5' 340 339 self.browser.getControl(name="form.entry_mode").value = ['ug_ft'] 341 340 self.browser.getControl(name="form.entry_session").value = ['2014'] … … 344 343 self.browser.getControl(name="form.phone.ext").value = '5678' 345 344 self.browser.getControl(name="form.charge").value = ['nigeria'] 345 image = open(SAMPLE_IMAGE, 'rb') 346 ctrl = self.browser.getControl(name='form.passport') 347 file_ctrl = ctrl.mech_control 348 file_ctrl.add_file(image, filename='myphoto.jpg') 346 349 self.browser.getControl("Save").click() 347 350 self.browser.getControl("Add online payment ticket").click() … … 349 352 self.assertTrue('<span>40000.0</span>' in self.browser.contents) 350 353 self.assertEqual(applicant.values()[0].amount_auth, 40000.0) 354 IWorkflowState(applicant).setState('submitted') 355 self.browser.getLink("My Data").click() 356 self.browser.getLink("Download application slip").click() 357 self.assertEqual(self.browser.headers['Status'], '200 Ok') 358 self.assertEqual(self.browser.headers['Content-Type'], 359 'application/pdf') 360 path = os.path.join(samples_dir(), 'tscf_application_slip.pdf') 361 open(path, 'wb').write(self.browser.contents) 362 print "Sample tscf_application_slip.pdf written to %s" % path 351 363 return
Note: See TracChangeset for help on using the changeset viewer.