Ignore:
Timestamp:
24 May 2019, 09:11:40 (5 years ago)
Author:
Henrik Bettermann
Message:

Implement course result validation workflow for lecturers.

File:
1 edited

Legend:

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

    r15421 r15422  
    44584458        self.assertTrue('COURSE1 score updated (None)' in logcontent)
    44594459
     4460    def test_lecturer_can_validate_courses(self):
     4461        # the form is locked after validation
     4462        self.login_as_lecturer()
     4463        self.student['studycourse']['100']['COURSE1'].score = None
     4464        self.browser.open(self.edit_scores_url)
     4465        self.browser.getControl(name="scores:list", index=0).value = ''
     4466        self.browser.getControl("Update scores").click()
     4467        self.browser.getControl("Validate").click()
     4468        self.assertTrue(
     4469            'You successfully validated the course results'
     4470            in self.browser.contents)
     4471        self.assertEqual(self.course.results_validation_session, 2004)
     4472        self.assertEqual(self.course.results_validated_by, 'Mercedes Benz')
     4473        self.assertEqual(self.browser.url, self.course_url)
     4474        # Lecturer can't open edit_scores again
     4475        self.browser.getLink("Update session 2004/2005 scores").click()
     4476        self.assertEqual(self.browser.url, self.course_url)
     4477        self.assertTrue(
     4478            'Course results have already been validated'
     4479            ' and can no longer be changed.'
     4480            in self.browser.contents)
     4481        # Also DownloadScoresView is blocked
     4482        self.browser.open(self.browser.url + '/download_scores')
     4483        self.assertEqual(self.browser.url, self.course_url)
     4484        self.assertTrue(
     4485            'Course results have already been validated'
     4486            ' and can no longer be changed.'
     4487            in self.browser.contents)
     4488        # Students Manager can open page ...
     4489        prmlocal = IPrincipalRoleManager(self.course)
     4490        prmlocal.assignRoleToPrincipal(
     4491            'waeup.local.LocalStudentsManager', 'mrslecturer')
     4492        self.browser.getLink("Update session 2004/2005 scores").click()
     4493        self.assertEqual(self.browser.url, self.edit_scores_url)
     4494        self.browser.getLink("Download csv file").click()
     4495        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     4496        self.assertEqual(self.browser.headers['Content-Type'],
     4497                         'text/csv; charset=UTF-8')
     4498        # ... but can't validate courses a second time
     4499        self.browser.open(self.edit_scores_url)
     4500        self.browser.getControl("Validate").click()
     4501        self.assertTrue(
     4502            'Course results have already been validated.'
     4503            in self.browser.contents)
     4504
    44604505    def test_lecturers_can_download_course_tickets(self):
    44614506        # A course ticket slip can be downloaded
Note: See TracChangeset for help on using the changeset viewer.