- Timestamp:
- 23 Aug 2015, 10:07:31 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r13123 r13215 144 144 # reg_number is the only field which has to be preset here 145 145 # because managers are allowed to edit this required field 146 self.applicant.firstname = u'Joan' 146 147 self.applicant.reg_number = u'1234' 147 148 self.applicant.course1 = certificate … … 1199 1200 1200 1201 def test_register_applicant_create(self): 1202 self.assertEqual(len(self.app['applicants'][container_name_1]), 1) 1201 1203 # An applicant can register himself. 1202 1204 self.browser.open(self.container_path) … … 1212 1214 self.assertEqual(self.browser.url, 1213 1215 self.container_path + '/registration_complete?email=xx%40yy.zz') 1216 # A new applicant has been created 1217 self.assertEqual(len(self.app['applicants'][container_name_1]), 2) 1214 1218 # The new applicant can be found in the catalog via the email address 1215 1219 cat = getUtility(ICatalog, name='applicants_catalog') … … 1225 1229 reg_number=(applicant.reg_number, applicant.reg_number))) 1226 1230 self.assertEqual(applicant,results[0]) 1231 return 1232 1233 def test_register_applicant_take_unused_record(self): 1234 # Create an unused record 1235 uu_applicant = createObject('waeup.Applicant') 1236 self.app['applicants'][container_name_1].addApplicant(uu_applicant) 1237 self.assertFalse(uu_applicant.record_used) 1238 self.assertEqual(len(self.app['applicants'][container_name_1]), 2) 1239 self.browser.open(self.container_path) 1240 self.browser.getLink("Register for application").click() 1241 # Fill the edit form with suitable values 1242 self.browser.getControl(name="form.firstname").value = 'Anna' 1243 self.browser.getControl(name="form.lastname").value = 'Kurios' 1244 self.browser.getControl(name="form.email").value = 'xx@yy.zz' 1245 self.browser.getControl(name="form.phone.country").value = ['+234'] 1246 self.browser.getControl(name="form.phone.area").value = '555' 1247 self.browser.getControl(name="form.phone.ext").value = '6666666' 1248 self.browser.getControl("Send login credentials").click() 1249 # No applicant has been created ... 1250 self.assertEqual(len(self.app['applicants'][container_name_1]), 2) 1251 # ... and the existing, formerly unused record has been used instead 1252 self.assertEqual(uu_applicant.lastname, 'Kurios') 1253 self.assertTrue(uu_applicant.record_used) 1227 1254 return 1228 1255
Note: See TracChangeset for help on using the changeset viewer.