Changeset 13894 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 8 Jun 2016, 15:48:51 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r13885 r13894 3806 3806 studylevel.level = 100 3807 3807 studylevel.level_session = 2004 3808 IWorkflowState(self.student).setState('courses validated') 3808 3809 self.student['studycourse'].addStudentStudyLevel( 3809 3810 self.certificate,studylevel) … … 3834 3835 # ... and contains the course ticket COURSE1 3835 3836 self.assertEqual(self.browser.contents, 3836 'matric_number, reg_number,student_id,display_fullname,level,code,'3837 'level_session,score\r\n234, 123,K1000000,Anna Tester,'3837 'matric_number,student_id,display_fullname,level,code,' 3838 'level_session,score\r\n234,K1000000,Anna Tester,' 3838 3839 '100,COURSE1,2004,\r\n') 3839 3840 self.assertEqual(len(self.app['datacenter'].running_exports), 1) … … 3861 3862 '- discarded: job_id=%s' % job_id in logcontent 3862 3863 ) 3864 3865 def test_course_download_lecturer(self): 3866 # We add study level 100 to the student's studycourse 3867 studylevel = StudentStudyLevel() 3868 studylevel.level = 100 3869 studylevel.level_session = 2004 3870 IWorkflowState(self.student).setState('courses validated') 3871 self.student['studycourse'].addStudentStudyLevel( 3872 self.certificate,studylevel) 3873 course1_path = 'http://localhost/app/faculties/fac1/dep1/courses/COURSE1' 3874 # Create lecturer 3875 self.app['users'].addUser('mrlecturer', 'mrlecturersecret') 3876 self.app['users']['mrlecturer'].email = 'mrlecturer@foo.ng' 3877 self.app['users']['mrlecturer'].title = 'Carlo Intelligent' 3878 prmglobal = IPrincipalRoleManager(self.course) 3879 prmglobal.assignRoleToPrincipal('waeup.local.Lecturer', 'mrlecturer') 3880 # Login as lecturer 3881 self.browser.open(self.login_path) 3882 self.browser.getControl(name="form.login").value = 'mrlecturer' 3883 self.browser.getControl(name="form.password").value = 'mrlecturersecret' 3884 self.browser.getControl("Login").click() 3885 self.assertMatches('...You logged in...', self.browser.contents) 3886 self.browser.open(course1_path) 3887 self.assertFalse('Export' in self.browser.contents) 3888 self.browser.getLink("Update scores").click() 3889 self.assertTrue('Current academic session not set' in self.browser.contents) 3890 self.app['configuration'].current_academic_session = 2004 3891 self.browser.getLink("Update scores").click() 3892 self.browser.getLink("Download editable tickets").click() 3893 self.assertEqual(self.browser.headers['Status'], '200 Ok') 3894 self.assertEqual(self.browser.headers['Content-Type'], 3895 'text/csv; charset=UTF-8') 3896 self.assertEqual(self.browser.contents, 'matric_number,student_id,' 3897 'display_fullname,level,code,level_session,score\r\n234,' 3898 'K1000000,Anna Tester,100,COURSE1,2004,\r\n') 3863 3899 3864 3900 def test_export_departmet_officers(self):
Note: See TracChangeset for help on using the changeset viewer.