Changeset 13964
- Timestamp:
- 21 Jun 2016, 08:30:14 (8 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py
r13963 r13964 18 18 import grok 19 19 import csv 20 import textwrap 20 21 from cStringIO import StringIO 21 22 from zope.i18n import translate … … 29 30 from waeup.kofa.students.interfaces import IStudentsUtils, IStudent 30 31 from waeup.kofa.students.workflow import PAID, REGISTERED 32 from waeup.kofa.students.studylevel import getGradeWeightFromScore 31 33 from waeup.kofa.students.browser import ( 32 34 StartClearancePage, … … 657 659 _('Level'), 658 660 _('Exam\nScore'), 659 _(' CA'),660 _('Total '),661 _(' CA '), 662 _('Total '), 661 663 _('Grade'), 662 664 ],] … … 666 668 if None in (ticket.score, ticket.ca): 667 669 total = 'n/a' 670 grade = 'n/a' 668 671 else: 669 672 total = ticket.score + ticket.ca 673 grade = getGradeWeightFromScore(total)[0] 674 fullname = textwrap.fill(ticket.student.display_fullname, 30) 670 675 row = [no, 671 676 ticket.student.matric_number, 672 677 ticket.student.reg_number, 673 ticket.student.display_fullname,678 fullname, 674 679 ticket.student.translated_state, 675 680 ticket.student.certcode, … … 678 683 ticket.score, 679 684 total, 680 ticket.grade,685 grade, 681 686 ] 682 687 tickets.append(row) -
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r13963 r13964 336 336 self.student['studycourse']['100']['COURSE1'].ca, 77) 337 337 338 def test_lecturers_can_download_course_tickets(self): 339 # A course ticket slip can be downloaded 340 self.login_as_lecturer() 341 pdf_url = '%s/coursetickets.pdf' % self.course_url 342 self.browser.open(pdf_url) 343 self.assertEqual(self.browser.headers['Status'], '200 Ok') 344 self.assertEqual( 345 self.browser.headers['Content-Type'], 'application/pdf') 346 path = os.path.join(samples_dir(), 'coursetickets.pdf') 347 open(path, 'wb').write(self.browser.contents) 348 print "Sample PDF coursetickets.pdf written to %s" % path 349 338 350 class StudentUITests(StudentsFullSetup): 339 351 """Tests for customized student class views and pages
Note: See TracChangeset for help on using the changeset viewer.