Changeset 8627
- Timestamp:
- 5 Jun 2012, 06:04:00 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r8589 r8627 1034 1034 self.flash(_('No application record found.')) 1035 1035 return 1036 elif applicant.password is not None: 1037 self.flash(_('Your password has already been set. ' 1036 elif applicant.password is not None and \ 1037 applicant.state != INITIALIZED: 1038 self.flash(_('Your password has already been set and used. ' 1038 1039 'Please proceed to the login page.')) 1039 1040 return -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r8602 r8627 489 489 self.assertEqual(self.browser.headers['Status'], '200 Ok') 490 490 self.fill_correct_values() 491 self.assertTrue(IUserAccount(self.applicant).checkPassword('apwd')) 491 492 self.browser.getControl("Save").click() 492 493 self.assertMatches('...Form has been saved...', self.browser.contents) … … 931 932 self.assertTrue('No application record found.' 932 933 in self.browser.contents) 933 # Even with the correct firstname we can't register because 934 # password has already been set. 934 # Even with the correct firstname we can't register if a 935 # password has been set and used. 936 IWorkflowState(self.applicant).setState('started') 935 937 self.browser.getControl(name="form.firstname").value = 'John' 936 938 self.browser.getControl(name="form.reg_number").value = '1234' 937 939 self.browser.getControl("Get login credentials").click() 938 self.assertTrue('Your password has already been set .'940 self.assertTrue('Your password has already been set and used.' 939 941 in self.browser.contents) 940 # We unset the password and try to register again. 941 IUserAccount( 942 self.app['applicants']['app2009'][ 943 self.applicant.application_number]).context.password = None 942 #IUserAccount( 943 # self.app['applicants']['app2009'][ 944 # self.applicant.application_number]).context.password = None 945 # Even without unsetting the password we can re-register if state 946 # is 'initialized' 947 IWorkflowState(self.applicant).setState('initialized') 944 948 self.browser.open(self.container_path + '/register') 945 949 # The firstname field, used for verification, is not case-sensitive. 946 950 self.browser.getControl(name="form.firstname").value = 'jOhn' 947 951 self.browser.getControl(name="form.reg_number").value = '1234' 948 self.browser.getControl(name="form.email").value = ' xx@yy.zz'952 self.browser.getControl(name="form.email").value = 'new@yy.zz' 949 953 self.browser.getControl("Get login credentials").click() 950 954 # Yeah, we succeded ... … … 955 959 results = list( 956 960 cat.searchResults( 957 email=(' xx@yy.zz', 'xx@yy.zz')))961 email=('new@yy.zz', 'new@yy.zz'))) 958 962 self.assertEqual(self.applicant,results[0]) 959 963 return
Note: See TracChangeset for help on using the changeset viewer.