Ignore:
Timestamp:
19 Apr 2022, 12:11:11 (3 years ago)
Author:
Henrik Bettermann
Message:

Only 7 schools are allowed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/tests/test_browser.py

    r16918 r16925  
    192192       
    193193    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)
    197204        IWorkflowState(self.tpuapplicant).setState('paid')
    198205        self.browser.open(self.login_path)
     
    204211        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
    205212        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']
    207214        image = open(SAMPLE_IMAGE, 'rb')
    208215        ctrl = self.browser.getControl(name='form.passport')
     
    224231            IWorkflowState(dummy).setState('submitted')
    225232        IWorkflowState(self.tpuapplicant).setState('paid')
    226         self.tpuapplicant.school = None
    227233        self.tpuapplicant.locked = False
    228234        self.browser.open(self.tpuapplicant_path + '/edit')
     
    233239        self.assertEqual(self.tpuapplicant.state, 'paid')
    234240        # 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 = 100
    240         certificate.end_level = 500
    241         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'
    242248        self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
    243             certificate)
     249            certificate2)
    244250        # Create one applicant with same subject and same school
    245251        dummy = createObject(u'waeup.Applicant')
     
    247253        dummy.lastname = u'Doe %s' %i
    248254        dummy.school = 'tpu0012'
    249         dummy.subj_comb = self.certificate
     255        dummy.subj_comb = certificate1
    250256        self.app['applicants'][
    251257            self.tpucontainer.code].addApplicant(dummy)
     
    253259        self.browser.open(self.tpuapplicant_path + '/edit')
    254260        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']
    256262        self.browser.getControl("Finally Submit").click()
    257263        self.assertTrue("Maximum number of applications per school exceeded."
     
    261267        self.browser.open(self.tpuapplicant_path + '/edit')
    262268        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']
    264270        self.browser.getControl("Finally Submit").click()
    265271        self.assertEqual(self.tpuapplicant.state, 'submitted')
Note: See TracChangeset for help on using the changeset viewer.