Ignore:
Timestamp:
20 Nov 2015, 10:23:08 (9 years ago)
Author:
Henrik Bettermann
Message:

Add personal data slip.

File:
1 edited

Legend:

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

    r13462 r13489  
    499499        return
    500500
     501    def test_personal_data_slip(self):
     502        # Login as student
     503        self.browser.open(self.login_path)
     504        IWorkflowState(self.student).setState('school fee paid')
     505        self.browser.open(self.login_path)
     506        self.browser.getControl(name="form.login").value = self.student_id
     507        self.browser.getControl(name="form.password").value = 'spwd'
     508        self.browser.getControl("Login").click()
     509        self.browser.getLink("Personal Data").click()
     510        self.assertRaises(
     511            LinkNotFoundError,
     512            self.browser.getLink, 'Download personal data slip')
     513        self.student.father_name = u'Rudolf'
     514        self.browser.open(self.personal_path)
     515        self.browser.getLink("Download personal data slip").click()
     516        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     517        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
     518        path = os.path.join(samples_dir(), 'personal_data_slip.pdf')
     519        open(path, 'wb').write(self.browser.contents)
     520        print "Sample PDF personal_data_slip.pdf written to %s" % path
     521        return
     522
    501523    def test_student_course_registration(self):
    502524        IWorkflowState(self.student).setState('school fee paid')
Note: See TracChangeset for help on using the changeset viewer.