Changeset 15401 for main/waeup.uniben


Ignore:
Timestamp:
7 May 2019, 06:38:53 (6 years ago)
Author:
Henrik Bettermann
Message:

Show gpa on course result slip.

Location:
main/waeup.uniben/trunk/src/waeup/uniben/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py

    r15371 r15401  
    546546            )
    547547
    548 class UnibenExportPDFCourseResultSlip(ExportPDFCourseRegistrationSlip):
     548class ExportPDFCourseResultSlip(ExportPDFCourseRegistrationSlip):
    549549    """Deliver a PDF slip of the context.
    550550    """
    551551
    552552    grok.name('course_result_slip.pdf')
     553
     554    form_fields = grok.AutoFields(ICustomStudentStudyLevel).omit('level')
    553555
    554556    @property
     
    605607                             ])
    606608        return students_utils.renderPDF(
    607             self, 'course_registration_slip.pdf',
     609            self, 'course_result_slip.pdf',
    608610            self.context.student, studentview,
    609611            tableheader=tableheader,
  • main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py

    r15371 r15401  
    480480        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    481481        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
     482        path = os.path.join(samples_dir(), 'course_registration_slip.pdf')
     483        open(path, 'wb').write(self.browser.contents)
     484        print "Sample PDF course_registration_slip.pdf written to %s" % path
     485       # Students can always download pdf course result slip
     486        self.browser.open(
     487            self.student_path + '/studycourse/100/course_result_slip.pdf')
     488        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     489        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
     490        path = os.path.join(samples_dir(), 'course_result_slip.pdf')
     491        open(path, 'wb').write(self.browser.contents)
     492        print "Sample PDF course_result_slip.pdf written to %s" % path
    482493
    483494    def test_get_returning_data(self):
Note: See TracChangeset for help on using the changeset viewer.