Changeset 10350 for main/waeup.imostate/src/waeup/imostate/applicants/tests
- Timestamp:
- 22 Jun 2013, 21:39:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.imostate/src/waeup/imostate/applicants/tests/test_browser.py
r10340 r10350 328 328 fd = storage.getFile(file_id) 329 329 self.assertTrue(fd is None) 330 331 def test_certificate_source(self):332 # We add a second 'alternative' certificate333 certificate = createObject('waeup.Certificate')334 certificate.code = 'CERT2'335 certificate.title = 'New Certificate'336 certificate.application_category = 'basic'337 self.app['faculties']['fac1']['dep1'].certificates.addCertificate(338 certificate)339 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')340 self.browser.open(self.edit_path)341 self.assertFalse('course2' in self.browser.contents)342 self.certificate.custom_textline_1 = u'Maths, Physics'343 self.certificate.custom_float_1 = 50.0344 certificate.custom_textline_1 = u'German, Physics'345 certificate.custom_float_1 = 30.0346 notify(grok.ObjectModifiedEvent(certificate))347 self.browser.open(self.edit_path)348 # Score must be set and below the limit349 # of course1 to see course2 field350 self.applicant.jamb_score = 20351 self.browser.open(self.edit_path)352 self.assertTrue('course2' in self.browser.contents)353 # But 20 is not enough to select the alternative CERT2354 self.assertFalse(355 'value="CERT2">CERT2 - New Certificate'356 in self.browser.contents)357 self.applicant.jamb_score = 30358 self.browser.open(self.edit_path)359 # 30 is enough360 self.assertTrue('course2' in self.browser.contents)361 self.assertTrue(362 'value="CERT2">CERT2 - New Certificate [German, Physics, 30]</option>'363 in self.browser.contents)364 365 def test_low_jamb_score(self):366 self.login()367 self.assertFalse('<select id="form.course2" name="form.course2" size="1" >'368 in self.browser.contents)369 self.certificate.custom_textline_1 = u'Maths, Physics'370 self.certificate.custom_float_1 = 50.0371 self.applicant.jamb_score = 40372 self.browser.open(self.edit_path)373 self.assertTrue('<select id="form.course2" name="form.course2" size="1" >'374 in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.