Changeset 7426 for main/waeup.sirp/trunk/src
- Timestamp:
- 21 Dec 2011, 12:08:05 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py
r7424 r7426 79 79 # Add an applicants container 80 80 applicantscontainer = ApplicantsContainer() 81 #applicantscontainer.ac_prefix = 'APP'82 81 applicantscontainer.code = u'app2009' 83 82 applicantscontainer.prefix = 'app' … … 140 139 # applicant object created. 141 140 self.browser.open(self.login_path) 142 self.browser.getControl(name="form.login").value = self.applicant.applicant_id 141 self.browser.getControl( 142 name="form.login").value = self.applicant.applicant_id 143 143 self.browser.getControl(name="form.password").value = 'apwd' 144 144 self.browser.getControl("Login").click() … … 170 170 self.assertFalse( 171 171 'Manage' in self.browser.contents) 172 173 172 return 173 174 174 def test_anonymous_no_actions(self): 175 175 # Make sure anonymous users cannot access actions … … 198 198 self.assertEqual(self.browser.headers['Status'], '200 Ok') 199 199 self.assertEqual(self.browser.url, self.manage_root_path) 200 return 200 201 201 202 def test_manage_actions_access(self): … … 245 246 self.browser.getControl(name="form.provider").value = [ 246 247 'waeup.sirp.applicants.ApplicantsContainer'] 247 #self.browser.getControl(name="form.ac_prefix").value = ['APP']248 self.browser.getControl(name="form.application_category").value = ['basic']248 self.browser.getControl( 249 name="form.application_category").value = ['basic'] 249 250 self.browser.getControl("Add applicants container").click() 250 251 self.assertTrue('Added:' in self.browser.contents) … … 257 258 self.browser.getControl(name="form.provider").value = [ 258 259 'waeup.sirp.applicants.ApplicantsContainer'] 259 #self.browser.getControl(name="form.ac_prefix").value = ['APP']260 self.browser.getControl(name="form.application_category").value = ['basic']260 self.browser.getControl( 261 name="form.application_category").value = ['basic'] 261 262 self.browser.getControl("Add applicants container").click() 262 self.assertTrue('exists already in the database' in self.browser.contents) 263 self.assertTrue('exists already in the database' 264 in self.browser.contents) 263 265 self.browser.open(self.manage_root_path) 264 266 ctrl = self.browser.getControl(name='val_id') … … 272 274 'waeup.sirp.applicants.ApplicantsContainer'] 273 275 #self.browser.getControl(name="form.ac_prefix").value = ['APP'] 274 self.browser.getControl(name="form.application_category").value = ['basic'] 276 self.browser.getControl( 277 name="form.application_category").value = ['basic'] 275 278 self.browser.getControl("Add applicants container").click() 276 279 del self.app['applicants']['app2010'] … … 322 325 self.browser.getControl("Save").click() 323 326 self.assertMatches('...Form has been saved...', self.browser.contents) 324 self.assertMatches('...Application started by Manager...', self.browser.contents) 327 self.assertMatches('...Application started by Manager...', 328 self.browser.contents) 325 329 self.browser.open(self.view_path) 326 330 self.assertEqual(self.browser.headers['Status'], '200 Ok') … … 334 338 self.browser.getControl(name="control_password").value = 'secre' 335 339 self.browser.getControl("Save").click() 336 self.assertMatches('...Passwords do not match...', self.browser.contents) 340 self.assertMatches('...Passwords do not match...', 341 self.browser.contents) 337 342 self.browser.getControl(name="password").value = 'secret' 338 343 self.browser.getControl(name="control_password").value = 'secret' … … 342 347 self.browser.open(self.slip_path) 343 348 self.assertEqual(self.browser.headers['Status'], '200 Ok') 344 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 349 self.assertEqual(self.browser.headers['Content-Type'], 350 'application/pdf') 345 351 # Managers can view applicants even if certificate has been removed 346 352 del self.app['faculties']['fac1']['dep1'].certificates['CERT1'] … … 601 607 self.fill_correct_values() 602 608 self.browser.getControl("Add online payment ticket").click() 603 self.assertMatches('...Payment ticket created...', self.browser.contents) 604 # Payment ticket can be removed if they haven't received a valid callback 609 self.assertMatches('...Payment ticket created...', 610 self.browser.contents) 611 # Payment ticket can be removed if they haven't received a 612 # valid callback 605 613 ctrl = self.browser.getControl(name='val_id') 606 614 value = ctrl.options[0] … … 634 642 self.browser.getLink("Download payment receipt").click() 635 643 self.assertEqual(self.browser.headers['Status'], '200 Ok') 636 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 644 self.assertEqual(self.browser.headers['Content-Type'], 645 'application/pdf') 637 646 # Applicant is is in state 'paid' 638 647 self.browser.open(self.view_path) … … 665 674 # since the passport confirmation box was not ticked 666 675 self.assertTrue( 667 'Passport picture confirmation box not ticked' in self.browser.contents) 676 'Passport picture confirmation box not ticked' 677 in self.browser.contents) 668 678 self.browser.getControl(name="confirm_passport").value = True 669 679 self.browser.getControl("Final Submit").click() … … 675 685 'The requested form is locked' in self.browser.contents) 676 686 self.browser.goBack(count=1) 677 #import pdb; pdb.set_trace()678 687 self.browser.getControl("Final Submit").click() 679 688 self.assertTrue( … … 696 705 self.browser.open(self.edit_path) 697 706 self.assertEqual(self.browser.headers['Status'], '200 Ok') 698 #print self.browser.contents699 707 self.assertTrue( 700 708 'The requested form is locked' in self.browser.contents) … … 720 728 self.assertEqual(self.browser.url, 721 729 self.container_path + '/registration_complete?email=xx%40yy.zz') 730 return 722 731 723 732 def test_register_applicant_wo_phone(self): … … 732 741 self.assertEqual(self.browser.url, 733 742 self.container_path + '/registration_complete?email=xx%40yy.zz') 734 743 return
Note: See TracChangeset for help on using the changeset viewer.