Changeset 16925 for main/waeup.fceokene/trunk/src/waeup/fceokene/applicants
- Timestamp:
- 19 Apr 2022, 12:11:11 (3 years ago)
- Location:
- main/waeup.fceokene/trunk/src/waeup/fceokene/applicants
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/browser.py
r16918 r16925 214 214 container = self.context.__parent__ 215 215 counter = 0 216 target = getattr(container, 'prefix', None) 217 if target == 'tpu': 218 max = 10 219 else: 220 max = 7 216 221 for appl in container.values(): 217 222 if appl != self.context \ … … 221 226 if appl.subj_comb == data.get('subj_comb'): 222 227 return True 223 if counter == 10:228 if counter == max: 224 229 return True 225 230 return False -
main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/schools_utp.py
r16918 r16925 5 5 'utp0004': ('Zone 01','Otite, Ogaminana, Obangede','Ebira Community Secondary School, Ogaminana'), 6 6 'utp0005': ('Zone 01','Otite, Ogaminana, Obangede','Government Science Secondary School, Ogaminana '), 7 'utp0006': ('Zone 01','Otite, Ogaminana, Obangede',' besideAudu Wokili Academy, Nagazi Uvete'),7 'utp0006': ('Zone 01','Otite, Ogaminana, Obangede','Audu Wokili Academy, Nagazi Uvete'), 8 8 'utp0007': ('Zone 01','Otite, Ogaminana, Obangede','Acess Secondary school, nagazi uvete'), 9 9 'utp0008': ('Zone 01','Otite, Ogaminana, Obangede','Government Girls Secondary School, Otutu'), -
main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/tests/test_browser.py
r16918 r16925 192 192 193 193 def test_final_submit_tpu(self): 194 self.certificate.application_category = 'basic' 195 self.certificate.title = 'NCECert1' 196 notify(grok.ObjectModifiedEvent(self.certificate)) 194 # Create NCE certificate 195 certificate1 = createObject('waeup.Certificate') 196 certificate1.application_category = 'basic' 197 certificate1.code = 'NCECERT1' 198 certificate1.title = 'NCECert1' 199 certificate1.start_level = 100 200 certificate1.end_level = 500 201 certificate1.study_mode = u'nce_ft' 202 self.app['faculties']['fac1']['dep1'].certificates.addCertificate( 203 certificate1) 197 204 IWorkflowState(self.tpuapplicant).setState('paid') 198 205 self.browser.open(self.login_path) … … 204 211 self.browser.getControl(name="form.email").value = 'xx@yy.zz' 205 212 self.browser.getControl(name="form.school").value = ['tpu0010'] 206 self.browser.getControl(name="form.subj_comb").value = [' CERT1']213 self.browser.getControl(name="form.subj_comb").value = ['NCECERT1'] 207 214 image = open(SAMPLE_IMAGE, 'rb') 208 215 ctrl = self.browser.getControl(name='form.passport') … … 224 231 IWorkflowState(dummy).setState('submitted') 225 232 IWorkflowState(self.tpuapplicant).setState('paid') 226 self.tpuapplicant.school = None227 233 self.tpuapplicant.locked = False 228 234 self.browser.open(self.tpuapplicant_path + '/edit') … … 233 239 self.assertEqual(self.tpuapplicant.state, 'paid') 234 240 # Create second certificate 235 certificate = createObject('waeup.Certificate')236 certificate .code = 'CERT2'237 certificate .title = 'NCECert2'238 certificate .application_category = 'basic'239 certificate .start_level = 100240 certificate .end_level = 500241 certificate .study_mode = u'nce_ft'241 certificate2 = createObject('waeup.Certificate') 242 certificate2.code = 'NCECERT2' 243 certificate2.title = 'NCECert2' 244 certificate2.application_category = 'basic' 245 certificate2.start_level = 100 246 certificate2.end_level = 500 247 certificate2.study_mode = u'nce_ft' 242 248 self.app['faculties']['fac1']['dep1'].certificates.addCertificate( 243 certificate )249 certificate2) 244 250 # Create one applicant with same subject and same school 245 251 dummy = createObject(u'waeup.Applicant') … … 247 253 dummy.lastname = u'Doe %s' %i 248 254 dummy.school = 'tpu0012' 249 dummy.subj_comb = self.certificate255 dummy.subj_comb = certificate1 250 256 self.app['applicants'][ 251 257 self.tpucontainer.code].addApplicant(dummy) … … 253 259 self.browser.open(self.tpuapplicant_path + '/edit') 254 260 self.browser.getControl(name="form.school").value = ['tpu0012'] 255 self.browser.getControl(name="form.subj_comb").value = [' CERT1']261 self.browser.getControl(name="form.subj_comb").value = ['NCECERT1'] 256 262 self.browser.getControl("Finally Submit").click() 257 263 self.assertTrue("Maximum number of applications per school exceeded." … … 261 267 self.browser.open(self.tpuapplicant_path + '/edit') 262 268 self.browser.getControl(name="form.school").value = ['tpu0012'] 263 self.browser.getControl(name="form.subj_comb").value = [' CERT2']269 self.browser.getControl(name="form.subj_comb").value = ['NCECERT2'] 264 270 self.browser.getControl("Finally Submit").click() 265 271 self.assertEqual(self.tpuapplicant.state, 'submitted')
Note: See TracChangeset for help on using the changeset viewer.