Ignore:
Timestamp:
4 Sep 2017, 07:37:44 (7 years ago)
Author:
Henrik Bettermann
Message:

Add JUPEB result slip (first draft).

File:
1 edited

Legend:

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

    r14588 r14834  
    3131from waeup.kofa.authentication import LocalRoleSetEvent
    3232from waeup.kofa.app import University
     33from waeup.kofa.university.faculty import Faculty
     34from waeup.kofa.university.department import Department
    3335from waeup.kofa.students.tests.test_browser import StudentsFullSetup
    3436from waeup.kofa.students.accommodation import BedTicket
     
    211213        self.browser.open(self.student_path)
    212214        self.assertFalse('examination schedule slip' in self.browser.contents)
     215
     216    def test_jupeb_result_slip(self):
     217        self.student.flash_notice = u'My JUPEB results'
     218        self.browser.open(self.login_path)
     219        self.browser.getControl(name="form.login").value = self.student_id
     220        self.browser.getControl(name="form.password").value = 'spwd'
     221        self.browser.getControl("Login").click()
     222        self.assertFalse('JUPEB result slip' in self.browser.contents)
     223        # Create JUPEB faculty
     224        cert = createObject('waeup.Certificate')
     225        cert.code = u'xyz'
     226        self.app['faculties']['JUPEB'] = Faculty(code=u'JUPEB')
     227        self.app['faculties']['JUPEB']['dep1'] = Department(code=u'dep1')
     228        self.app['faculties']['JUPEB']['dep1'].certificates.addCertificate(cert)
     229        self.student['studycourse'].certificate = cert
     230        self.browser.open(self.student_path)
     231        self.browser.getLink("Download JUPEB result slip").click()
     232        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     233        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
     234        path = os.path.join(samples_dir(), 'jupeb_result_slip.pdf')
     235        open(path, 'wb').write(self.browser.contents)
     236        print "Sample PDF jupeb_result_slip.pdf written to %s" % path
     237        self.student.flash_notice = u''
     238        self.browser.open(self.student_path)
     239        self.assertFalse('JUPEB result slip' in self.browser.contents)
    213240
    214241    def test_manage_payments(self):
Note: See TracChangeset for help on using the changeset viewer.