Ignore:
Timestamp:
22 Aug 2023, 13:47:07 (17 months ago)
Author:
Henrik Bettermann
Message:

Add application type and category.

Add examination clearance slip.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/tests/test_browser.py

    r16721 r17554  
    3333from waeup.kofa.interfaces import (
    3434    IExtFileStore, IFileStoreNameChooser)
     35from waeup.kofa.browser.tests.test_pdf import samples_dir
    3536from waeup.kofa.students.interfaces import IStudentsUtils
    3637from kofacustom.unidel.testing import FunctionalLayer
     
    4243    layer = FunctionalLayer
    4344
    44     def test_dummytest(self):
    45         return
     45    def test_student_examclearance_slip(self):
     46        self.certificate.study_mode = 'ug_ft'
     47        # Student cant login if their password is not set
     48        IWorkflowState(self.student).setState('courses registered')
     49        self.browser.open(self.login_path)
     50        self.browser.getControl(name="form.login").value = self.student_id
     51        self.browser.getControl(name="form.password").value = 'spwd'
     52        self.browser.getControl("Login").click()
     53        self.assertMatches(
     54            '...You logged in...', self.browser.contents)
     55        self.browser.getLink("Base Data").click()
     56        self.browser.getLink("Download examination clearance slip").click()
     57        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     58        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
     59        path = os.path.join(samples_dir(), 'examclearance_slip.pdf')
     60        open(path, 'wb').write(self.browser.contents)
     61        print "Sample exampclearance_slip.pdf written to %s" % path
Note: See TracChangeset for help on using the changeset viewer.