Changeset 15401
- Timestamp:
- 7 May 2019, 06:38:53 (6 years ago)
- 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 546 546 ) 547 547 548 class UnibenExportPDFCourseResultSlip(ExportPDFCourseRegistrationSlip):548 class ExportPDFCourseResultSlip(ExportPDFCourseRegistrationSlip): 549 549 """Deliver a PDF slip of the context. 550 550 """ 551 551 552 552 grok.name('course_result_slip.pdf') 553 554 form_fields = grok.AutoFields(ICustomStudentStudyLevel).omit('level') 553 555 554 556 @property … … 605 607 ]) 606 608 return students_utils.renderPDF( 607 self, 'course_re gistration_slip.pdf',609 self, 'course_result_slip.pdf', 608 610 self.context.student, studentview, 609 611 tableheader=tableheader, -
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r15371 r15401 480 480 self.assertEqual(self.browser.headers['Status'], '200 Ok') 481 481 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 482 493 483 494 def test_get_returning_data(self):
Note: See TracChangeset for help on using the changeset viewer.