Ignore:
Timestamp:
8 Jun 2016, 15:48:51 (8 years ago)
Author:
Henrik Bettermann
Message:

Add DownloadScoresView which is for lecturers only. Remove
waeup.showStudents from Lecturer role. Adjust
DataForLecturerExporter. Only editable course tickets are being
exported.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r13885 r13894  
    38063806        studylevel.level = 100
    38073807        studylevel.level_session = 2004
     3808        IWorkflowState(self.student).setState('courses validated')
    38083809        self.student['studycourse'].addStudentStudyLevel(
    38093810            self.certificate,studylevel)
     
    38343835        # ... and contains the course ticket COURSE1
    38353836        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,'
    38383839            '100,COURSE1,2004,\r\n')
    38393840        self.assertEqual(len(self.app['datacenter'].running_exports), 1)
     
    38613862            '- discarded: job_id=%s' % job_id in logcontent
    38623863            )
     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')
    38633899
    38643900    def test_export_departmet_officers(self):
Note: See TracChangeset for help on using the changeset viewer.