Changeset 7413 for main/waeup.sirp/trunk/src/waeup/sirp
- Timestamp:
- 21 Dec 2011, 06:36:38 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r7372 r7413 351 351 # and can perform actions 352 352 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 353 354 353 self.browser.open(self.student_path) 355 354 self.assertEqual(self.browser.headers['Status'], '200 Ok') … … 408 407 # Only the Application Slip does not exist 409 408 self.assertFalse('Application Slip' in self.browser.contents) 409 return 410 411 def test_manage_contact_student(self): 412 # Managers can contact student 413 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 414 self.browser.open(self.student_path) 415 self.browser.getLink("Send email").click() 416 self.browser.getControl(name="form.subject").value = 'Important subject' 417 self.browser.getControl(name="form.body").value = 'Hello!' 418 self.browser.getControl("Send message now").click() 419 self.assertTrue('Your message has been sent' in self.browser.contents) 410 420 return 411 421 … … 732 742 # Create clearance officer 733 743 self.app['users'].addUser('mrclear', 'mrclearsecret') 744 self.app['users']['mrclear'].email = 'mrclear@foo.ng' 745 self.app['users']['mrclear'].title = 'Carlo Pitter' 734 746 # Clearance officers need not necessarily to get 735 747 # the StudentsOfficer site role … … 792 804 self.assertTrue('Clearance has been annulled' in self.browser.contents) 793 805 urlmessage = 'Clearance+has+been+annulled' 806 # CO does now see the contact form 794 807 self.assertEqual(self.browser.url, self.student_path + 795 808 '/contactstudent?subject=%s' % urlmessage) … … 803 816 self.assertTrue('State: <span>clearance started</span>' 804 817 in self.browser.contents) 818 # CO does now also see the contact form and can send a message 819 self.browser.getControl(name="form.subject").value = 'Important subject' 820 self.browser.getControl(name="form.body").value = 'Clearance rejected' 821 self.browser.getControl("Send message now").click() 822 self.assertTrue('Your message has been sent' in self.browser.contents) 805 823 # The CO can't clear students if not in state 806 824 # clearance requested … … 818 836 # Create course adviser 819 837 self.app['users'].addUser('mrsadvise', 'mrsadvisesecret') 838 self.app['users']['mrsadvise'].email = 'mradvise@foo.ng' 839 self.app['users']['mrsadvise'].title = 'Helen Procter' 820 840 # Assign local CourseAdviser100 role for a certificate 821 841 cert = self.app['faculties']['fac1']['dep1'].certificates['CERT1'] … … 906 926 self.assertTrue('State: <span>school fee paid</span>' 907 927 in self.browser.contents) 928 # CA does now see the contact form and can send a message 929 self.browser.getControl(name="form.subject").value = 'Important subject' 930 self.browser.getControl(name="form.body").value = 'Course list rejected' 931 self.browser.getControl("Send message now").click() 932 self.assertTrue('Your message has been sent' in self.browser.contents) 908 933 # The CA can't validate courses if not in state 909 934 # courses registered … … 1554 1579 self.assertFalse('val_id' in self.browser.contents) 1555 1580 return 1581 1582 def test_change_password_request(self): 1583 self.browser.open('http://localhost/app/changepw') 1584 self.browser.getControl(name="form.reg_number").value = '123' 1585 self.browser.getControl(name="form.email").value = 'aa@aa.ng' 1586 self.browser.getControl("Get login credentials").click() 1587 self.assertTrue('An email with' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.