- Timestamp:
- 28 Feb 2022, 22:19:59 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/tests/test_browser.py
r15635 r16848 21 21 import pytz 22 22 import os 23 import grok 24 from zope.event import notify 23 25 from zope.component.hooks import setSite, clearSite 24 26 from zope.component import createObject … … 94 96 self.tpucontainer.code = u'tpu%s' % session 95 97 self.tpucontainer.prefix = u'tpu' 96 self.tpucontainer.application_category = u' no'98 self.tpucontainer.application_category = u'tpu' 97 99 self.tpucontainer.year = session 98 100 self.tpucontainer.application_fee = 300.0 … … 190 192 191 193 def test_final_submit_tpu(self): 194 self.certificate.application_category = 'tpu' 195 notify(grok.ObjectModifiedEvent(self.certificate)) 192 196 IWorkflowState(self.tpuapplicant).setState('paid') 193 197 self.browser.open(self.login_path) … … 199 203 self.browser.getControl(name="form.email").value = 'xx@yy.zz' 200 204 self.browser.getControl(name="form.school1").value = ['s0010'] 205 self.browser.getControl(name="form.subj_comb").value = ['CERT1'] 201 206 image = open(SAMPLE_IMAGE, 'rb') 202 207 ctrl = self.browser.getControl(name='form.passport') … … 226 231 in self.browser.contents) 227 232 self.assertEqual(self.tpuapplicant.state, 'paid') 233 # Create one applicant with same subject and same school 234 dummy = createObject(u'waeup.Applicant') 235 dummy.firstname = u'John' 236 dummy.lastname = u'Doe %s' %i 237 dummy.school1 = 's0012' 238 dummy.subj_comb = self.certificate 239 self.app['applicants'][ 240 self.tpucontainer.code].addApplicant(dummy) 241 IWorkflowState(dummy).setState('submitted') 242 self.browser.open(self.tpuapplicant_path + '/edit') 243 self.browser.getControl(name="form.school1").value = ['s0012'] 244 self.browser.getControl(name="form.subj_comb").value = ['CERT1'] 245 self.browser.getControl("Finally Submit").click() 246 self.assertTrue("Maximum number of applications per school exceeded." 247 in self.browser.contents) 248 self.assertEqual(self.tpuapplicant.state, 'paid') 249 self.browser.open(self.tpuapplicant_path + '/edit') 250 self.browser.getControl(name="form.school1").value = ['s0013'] 251 self.browser.getControl(name="form.subj_comb").value = ['CERT1'] 252 self.browser.getControl("Finally Submit").click() 253 self.assertTrue( 254 'Application submitted' in self.browser.contents) 255 self.assertEqual(self.tpuapplicant.state, 'submitted') 228 256 return 229 257
Note: See TracChangeset for help on using the changeset viewer.