- Timestamp:
- 4 Nov 2013, 09:19:39 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py
r10682 r10691 19 19 import shutil 20 20 import tempfile 21 from mechanize import LinkNotFoundError 21 22 from StringIO import StringIO 22 23 from hurry.workflow.interfaces import IWorkflowState, IWorkflowInfo … … 345 346 self.browser.contents) 346 347 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.