Ignore:
Timestamp:
4 Nov 2013, 09:19:39 (11 years ago)
Author:
Henrik Bettermann
Message:

Add Admission Notification Slip. The notification can be downloaded before payment, the slip after payment of school fee.

The difference between an admission slip/letter and a notification is still not clear.

File:
1 edited

Legend:

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

    r10682 r10691  
    1919import shutil
    2020import tempfile
     21from mechanize import LinkNotFoundError
    2122from StringIO import StringIO
    2223from hurry.workflow.interfaces import IWorkflowState, IWorkflowInfo
     
    345346                           self.browser.contents)
    346347        return
     348
     349    def test_pdf_slips(self):
     350        IWorkflowState(self.student).setState('school fee paid')
     351        # Login
     352        self.browser.open(self.login_path)
     353        self.browser.getControl(name="form.login").value = self.student_id
     354        self.browser.getControl(name="form.password").value = 'spwd'
     355        self.browser.getControl("Login").click()
     356        self.browser.open(self.student_path)
     357        self.browser.getLink("Download admission letter").click()
     358        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     359        self.assertEqual(self.browser.headers['Content-Type'],
     360                         'application/pdf')
     361        self.browser.open(self.student_path)
     362        self.assertRaises(
     363            LinkNotFoundError, self.browser.getLink, 'Download admission notification')
     364        self.browser.open(self.student_path, 'admission_notification.pdf')
     365        self.assertFalse('Not allowed' in self.browser.contents)
     366
     367        IWorkflowState(self.student).setState('cleared')
     368        self.browser.open(self.student_path)
     369        self.browser.getLink("Download admission notification").click()
     370        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     371        self.assertEqual(self.browser.headers['Content-Type'],
     372                         'application/pdf')
     373        self.browser.open(self.student_path)
     374        self.assertRaises(
     375            LinkNotFoundError, self.browser.getLink, 'Download admission letter')
     376        self.browser.open(self.student_path, 'admission_slip.pdf')
     377        self.assertFalse('Not allowed' in self.browser.contents)
     378        return
Note: See TracChangeset for help on using the changeset viewer.