- Timestamp:
- 28 Nov 2019, 08:21:23 (5 years ago)
- Location:
- main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/tests/test_browser.py
r15696 r15859 35 35 IExtFileStore, IFileStoreNameChooser) 36 36 from waeup.kofa.students.interfaces import IStudentsUtils 37 from waeup.kofa.tests.test_authentication import SECRET 37 38 from kofacustom.iuokada.testing import FunctionalLayer 38 39 … … 46 47 return 47 48 49 class OfficerUITests(StudentsFullSetup): 50 # Tests for Student class views and pages 51 52 layer = FunctionalLayer 53 54 def test_lib_idcard_officer(self): 55 # Create library officer 56 self.app['users'].addUser('mrlibrary', SECRET) 57 self.app['users']['mrlibrary'].email = 'library@foo.ng' 58 self.app['users']['mrlibrary'].title = 'Carlo Pitter' 59 prmglobal = IPrincipalRoleManager(self.app) 60 prmglobal.assignRoleToPrincipal( 61 'waeup.LibraryClearanceOfficer', 'mrlibrary') 62 prmglobal.assignRoleToPrincipal( 63 'waeup.StudentsOfficer', 'mrlibrary') 64 self.browser.open(self.login_path) 65 self.browser.getControl(name="form.login").value = 'mrlibrary' 66 self.browser.getControl(name="form.password").value = SECRET 67 self.browser.getControl("Login").click() 68 self.assertMatches('...You logged in...', self.browser.contents) 69 self.browser.open(self.student_path) 70 self.assertFalse('Download Library Id Card' in self.browser.contents) 71 self.browser.getLink("Switch library access").click() 72 self.assertTrue('Library access enabled' in self.browser.contents) 73 self.browser.getLink("Download Library 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(), 'lib_idcard_officer.pdf') 77 open(path, 'wb').write(self.browser.contents) 78 print "Sample PDF lib_idcard_officer.pdf written to %s" % path 48 79 49 80 class StudentUITests(StudentsFullSetup): … … 72 103 open(path, 'wb').write(self.browser.contents) 73 104 print "Sample PDF course_registration_slip.pdf written to %s" % path 105 106 def test_library_idcard(self): 107 IWorkflowState(self.student).setState('returning') 108 self.browser.open(self.login_path) 109 self.browser.getControl(name="form.login").value = self.student_id 110 self.browser.getControl(name="form.password").value = 'spwd' 111 self.browser.getControl("Login").click() 112 self.assertFalse('Library' in self.browser.contents) 113 self.student.library = True 114 self.browser.open(self.student_path) 115 self.browser.getLink("Download Library Id Card").click() 116 self.assertEqual(self.browser.headers['Status'], '200 Ok') 117 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 118 path = os.path.join(samples_dir(), 'lib_idcard_student.pdf') 119 open(path, 'wb').write(self.browser.contents) 120 print "Sample PDF lib_idcard_student.pdf written to %s" % path 121 self.assertTrue(self.student.library) 122 IWorkflowInfo(self.student).fireTransition('pay_school_fee') 123 self.assertFalse(self.student.library) -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/tests/test_export.py
r15733 r15859 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.