Changeset 15371 for main/waeup.uniben/trunk/src/waeup/uniben/students/tests
- Timestamp:
- 25 Mar 2019, 17:59:03 (6 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/students/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r15352 r15371 41 41 IExtFileStore, IFileStoreNameChooser) 42 42 from waeup.kofa.students.interfaces import IStudentsUtils 43 from waeup.kofa.tests.test_authentication import SECRET 43 44 from waeup.uniben.testing import FunctionalLayer 44 45 45 46 SAMPLE_FPM = os.path.join(os.path.dirname(__file__), 'sample.fpm') 47 48 class OfficerUITests(StudentsFullSetup): 49 # Tests for Student class views and pages 50 51 layer = FunctionalLayer 52 53 def test_jhl_idcard_officer(self): 54 # Create library officer 55 self.app['users'].addUser('mrlibrary', SECRET) 56 self.app['users']['mrlibrary'].email = 'library@foo.ng' 57 self.app['users']['mrlibrary'].title = 'Carlo Pitter' 58 prmglobal = IPrincipalRoleManager(self.app) 59 prmglobal.assignRoleToPrincipal( 60 'waeup.LibraryClearanceOfficer', 'mrlibrary') 61 prmglobal.assignRoleToPrincipal( 62 'waeup.StudentsOfficer', 'mrlibrary') 63 self.browser.open(self.login_path) 64 self.browser.getControl(name="form.login").value = 'mrlibrary' 65 self.browser.getControl(name="form.password").value = SECRET 66 self.browser.getControl("Login").click() 67 self.assertMatches('...You logged in...', self.browser.contents) 68 self.browser.open(self.student_path) 69 self.assertFalse('JHL' in self.browser.contents) 70 self.browser.getLink("Switch library access").click() 71 self.assertTrue('Library access enabled' in self.browser.contents) 72 self.assertTrue('JHL' in self.browser.contents) 73 self.browser.getLink("Download JHL Id Card").click() 74 self.assertEqual(self.browser.headers['Status'], '200 Ok') 75 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 76 path = os.path.join(samples_dir(), 'jhl_idcard_officer.pdf') 77 open(path, 'wb').write(self.browser.contents) 78 print "Sample PDF jhl_idcard_officer.pdf written to %s" % path 46 79 47 80 class StudentUITests(StudentsFullSetup): … … 219 252 self.browser.getControl(name="form.password").value = 'spwd' 220 253 self.browser.getControl("Login").click() 254 self.assertFalse('JHL' in self.browser.contents) 255 self.student.library = True 256 self.browser.open(self.student_path) 257 self.assertTrue('JHL' in self.browser.contents) 221 258 self.browser.getLink("Download JHL Id Card").click() 222 259 self.assertEqual(self.browser.headers['Status'], '200 Ok') 223 260 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 224 path = os.path.join(samples_dir(), 'jhl_idcard .pdf')261 path = os.path.join(samples_dir(), 'jhl_idcard_student.pdf') 225 262 open(path, 'wb').write(self.browser.contents) 226 print "Sample PDF jhl_idcard .pdf written to %s" % path263 print "Sample PDF jhl_idcard_student.pdf written to %s" % path 227 264 228 265 def test_jupeb_result_slip(self): -
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_export.py
r14853 r15371 56 56 'fst_sit_type,hq2_degree,hq2_disc,hq2_matric_no,hq2_school,' 57 57 'hq2_session,hq2_type,hq_degree,hq_disc,hq_fname,hq_matric_no,' 58 'hq_school,hq_session,hq_type,is_staff,lastname,lga, '58 'hq_school,hq_session,hq_type,is_staff,lastname,lga,library,' 59 59 'marit_stat,matric_number,middlename,nationality,' 60 60 'next_kin_address,next_kin_name,next_kin_phone,next_kin_relation,' … … 68 68 '"[(\'printing_craft_practice\', \'A1\')]",my clr code,1981-02-04#,,,' 69 69 'anna@sample.com,,,,,,,,,,,,,Anna,,,,,,"[(\'printing_craft_practice\', \'A1\')]"' 70 ',,,,,,,,,,,,,,,,Tester,,, 234,M.,NG,,,,,,,,,,'70 ',,,,,,,,,,,,,,,,Tester,,,,234,M.,NG,,,,,,,,,,' 71 71 '"Studentroad 21\nLagos 123456\n",,+234-123-12345#,,,123,,,,,' 72 72 '"[(\'printing_craft_practice\', \'A1\')]",,f,A111111,0,,,created,'
Note: See TracChangeset for help on using the changeset viewer.