- Timestamp:
- 15 Oct 2015, 17:18:41 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py
r13307 r13331 562 562 'W1000000 - ND/15/dep1/FT/001 assigned' in logcontent) 563 563 return 564 565 def test_student_fileupload(self): 566 # Students can edit clearance data 567 IWorkflowState(self.student).setState('clearance started') 568 self.browser.open(self.login_path) 569 self.browser.getControl(name="form.login").value = self.student_id 570 self.browser.getControl(name="form.password").value = 'spwd' 571 self.browser.getControl("Login").click() 572 self.browser.getLink("Clearance Data").click() 573 self.browser.getLink("Edit").click() 574 self.browser.getControl("Save and request clearance").click() 575 self.assertMatches('...Required input is missing...', 576 self.browser.contents) 577 self.student.nationality = u'DE' 578 self.browser.open(self.edit_clearance_path) 579 self.browser.getControl("Save and request clearance").click() 580 self.assertTrue( 581 'Missing: Birth Certificate, Acceptance Letter, LGA Identification, ' 582 'First Sitting Result, Second Sitting Result, ' 583 'Higher Qualification Result, Advanced Level Result, Certificate, ' 584 'Evidence of Name, Result Statement, Guarantor/Referee Letter, ' 585 'Affidavit of Good Conduct' 586 in self.browser.contents) 587 # Students can upload documents 588 ctrl = self.browser.getControl(name='birthcertificateupload') 589 file_obj = open(SAMPLE_IMAGE, 'rb') 590 file_ctrl = ctrl.mech_control 591 file_ctrl.add_file(file_obj, filename='my_birth_certificate.jpg') 592 self.browser.getControl( 593 name='upload_birthcertificateupload').click() 594 self.assertTrue( 595 'href="http://localhost/app/students/W1000000/birth_certificate"' 596 in self.browser.contents) 597 # The list of missing files is now slightly shorter 598 self.browser.getControl("Save and request clearance").click() 599 self.assertTrue( 600 'Missing: Acceptance Letter, LGA Identification, ' 601 'First Sitting Result, Second Sitting Result, ' 602 'Higher Qualification Result, Advanced Level Result, Certificate, ' 603 'Evidence of Name, Result Statement, Guarantor/Referee Letter, ' 604 'Affidavit of Good Conduct' 605 in self.browser.contents) 606 return
Note: See TracChangeset for help on using the changeset viewer.