Ignore:
Timestamp:
4 Nov 2013, 16:22:35 (11 years ago)
Author:
Henrik Bettermann
Message:

Add pdf registration form.

File:
1 edited

Legend:

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

    r10692 r10695  
    348348        return
    349349
    350     def test_pdf_slips(self):
     350    def test_admission_pdf_slips(self):
    351351        # Login
    352352        self.browser.open(self.login_path)
     
    367367        self.assertRaises(
    368368            LinkNotFoundError, self.browser.getLink, 'Download admission notification')
    369         self.browser.open(self.student_path, 'admission_notification.pdf')
    370         self.assertFalse('Not allowed' in self.browser.contents)
     369        self.browser.open(self.student_path + '/admission_notification.pdf')
     370        self.assertTrue('Not allowed' in self.browser.contents)
    371371        # admission notification
    372372        IWorkflowState(self.student).setState('cleared')
     
    382382        self.assertRaises(
    383383            LinkNotFoundError, self.browser.getLink, 'Download admission letter')
    384         self.browser.open(self.student_path, 'admission_slip.pdf')
    385         self.assertFalse('Not allowed' in self.browser.contents)
    386         return
    387 
    388     def test_course_registration_pdf_slip(self):
     384        self.browser.open(self.student_path + '/admission_slip.pdf')
     385        self.assertTrue('Not allowed' in self.browser.contents)
     386        return
     387
     388    def test_registration_pdf_slips(self):
    389389        # Student cant login if their password is not set
    390390        IWorkflowState(self.student).setState('school fee paid')
     
    407407        open(path, 'wb').write(self.browser.contents)
    408408        print "Sample PDF course_registration_slip.pdf written to %s" % path
    409         return
     409
     410        self.browser.open(self.student_path)
     411        self.browser.getLink("Download registration form").click()
     412        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     413        self.assertEqual(self.browser.headers['Content-Type'],
     414                         'application/pdf')
     415        path = os.path.join(samples_dir(), 'registration_form.pdf')
     416        open(path, 'wb').write(self.browser.contents)
     417        print "Sample PDF registration_form.pdf written to %s" % path
     418
     419        return
Note: See TracChangeset for help on using the changeset viewer.