- Timestamp:
- 3 Apr 2012, 20:40:17 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r8008 r8033 84 84 applicantscontainer.entry_level = 100 85 85 applicantscontainer.application_category = 'basic' 86 applicantscontainer.mode = 'create' 86 87 delta = timedelta(days=10) 87 88 applicantscontainer.startdate = date.today() - delta … … 248 249 self.browser.getControl(name="form.year").value = ['2010'] 249 250 self.browser.getControl(name="form.entry_level").value = ['100'] 251 self.browser.getControl(name="form.mode").value = ['create'] 250 252 self.browser.getControl( 251 253 name="form.application_category").value = ['basic'] … … 262 264 self.browser.getControl(name="form.year").value = ['2010'] 263 265 self.browser.getControl(name="form.entry_level").value = ['100'] 266 self.browser.getControl(name="form.mode").value = ['create'] 264 267 self.browser.getControl( 265 268 name="form.application_category").value = ['basic'] … … 276 279 self.browser.getControl(name="form.year").value = ['2010'] 277 280 self.browser.getControl(name="form.entry_level").value = ['100'] 281 self.browser.getControl(name="form.mode").value = ['create'] 278 282 #self.browser.getControl(name="form.ac_prefix").value = ['APP'] 279 283 self.browser.getControl( … … 788 792 layer = FunctionalLayer 789 793 790 def test_register_applicant (self):794 def test_register_applicant_create(self): 791 795 # An applicant can register himself. 792 796 self.browser.open(self.container_path) … … 802 806 self.assertEqual(self.browser.url, 803 807 self.container_path + '/registration_complete?email=xx%40yy.zz') 808 # Now we change the application mode and check if applicants 809 # can find and update imported records instead of creating new records. 810 # First we check what happens if record can't be found. 811 self.applicantscontainer.mode = 'update' 812 self.browser.open(self.container_path + '/register') 813 #self.browser.getControl(name="form.firstname").value = 'John' 814 self.browser.getControl(name="form.reg_number").value = 'anynumber' 815 self.browser.getControl(name="form.email").value = 'xx@yy.zz' 816 self.browser.getControl("Get login credentials").click() 817 self.assertTrue('No application record found.' 818 in self.browser.contents) 819 # Now we check if password has already been set. 820 #self.browser.getControl(name="form.firstname").value = 'John' 821 self.browser.getControl(name="form.reg_number").value = '1234' 822 self.browser.getControl("Get login credentials").click() 823 self.assertTrue('Your password has already been set.' 824 in self.browser.contents) 825 # We unset the password and try to register again. 826 IUserAccount( 827 self.app['applicants']['app2009'][ 828 self.applicant.application_number]).context.password = None 829 self.browser.open(self.container_path + '/register') 830 #self.browser.getControl(name="form.firstname").value = 'John' 831 self.browser.getControl(name="form.reg_number").value = '1234' 832 self.browser.getControl(name="form.email").value = 'xx@yy.zz' 833 self.browser.getControl("Get login credentials").click() 834 self.assertTrue('Your registration was successful.' 835 in self.browser.contents) 804 836 return 805 837
Note: See TracChangeset for help on using the changeset viewer.