Ignore:
Timestamp:
18 Sep 2018, 20:48:41 (6 years ago)
Author:
Henrik Bettermann
Message:

Add logging and history messages after signing.

Location:
main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students/browser.py

    r15146 r15148  
    11781178            return
    11791179        self.flash(_('Transcript signed.'))
     1180        ob_class = self.__implemented__.__name__.replace('waeup.kofa.','')
     1181        self.context.student.__parent__.logger.info(
     1182            '%s - %s - Transcript signed'
     1183            % (ob_class, self.context.student.student_id))
     1184        self.context.student.history.addMessage('Transcript signed')
    11801185        self.redirect(self.url(self.context))
    11811186        return
  • main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students/tests/test_browser.py

    r15143 r15148  
    21462146        # Officer can search for students in state 'transcript requested'
    21472147        self.browser.open(self.container_path)
    2148         self.browser.getControl(name="searchtype").value = ['transcript requested']
     2148        self.browser.getControl(name="searchtype").value = [
     2149            'transcript requested']
    21492150        self.browser.getControl("Find student(s)").click()
    21502151        self.assertTrue('Anna Tester' in self.browser.contents)
     
    21532154        # Officers can still edit studycourse, studylevel and course tickets.
    21542155        self.browser.open(self.studycourse_path + '/manage')
    2155         self.assertTrue('Undergraduate Full-Time</option>' in self.browser.contents)
     2156        self.assertTrue('Undergraduate Full-Time</option>'
     2157            in self.browser.contents)
    21562158        self.browser.getControl(name="form.certificate").value = ['CERT1']
    21572159        self.browser.getControl(name="form.current_session").value = ['2004']
     
    21782180        self.browser.open(self.studycourse_path + '/manage')
    21792181        self.assertTrue('The requested form is locked' in self.browser.contents)
    2180         self.assertFalse('Undergraduate Full-Time</option>' in self.browser.contents)
     2182        self.assertFalse('Undergraduate Full-Time</option>'
     2183            in self.browser.contents)
    21812184        self.browser.open(self.studycourse_path + '/100/manage')
    21822185        self.assertTrue('The requested form is locked' in self.browser.contents)
    21832186        self.browser.open(self.studycourse_path + '/100/COURSE1/manage')
    21842187        self.assertTrue('The requested form is locked' in self.browser.contents)
     2188        # Transcript can be signed if officer has the permission to sign
     2189        self.browser.open(self.studycourse_path + '/transcript')
     2190        self.assertFalse('Sign transcript' in self.browser.contents)
     2191        prmglobal = IPrincipalRoleManager(self.app)
     2192        prmglobal.assignRoleToPrincipal('waeup.TranscriptSignee', 'mrtranscript')
     2193        self.browser.open(self.studycourse_path + '/transcript')
     2194        self.browser.getLink("Sign transcript").click()
     2195        # Transcript signing has been logged ...
     2196        logfile = os.path.join(
     2197            self.app['datacenter'].storage, 'logs', 'students.log')
     2198        logcontent = open(logfile).read()
     2199        self.assertTrue(
     2200            'mrtranscript - students.browser.StudentTranscriptSignView - '
     2201            'K1000000 - Transcript signed' in logcontent)
     2202        # ... and appears in the student's history
     2203        self.browser.open(self.history_path)
     2204        self.assertTrue('Transcript signed by Ruth Gordon'
     2205            in self.browser.contents)
    21852206        # Officer can release the transcript
    21862207        self.browser.open(self.student_path)
Note: See TracChangeset for help on using the changeset viewer.