Ignore:
Timestamp:
28 Jul 2020, 10:19:11 (4 years ago)
Author:
Henrik Bettermann
Message:

Customize transcript application slip.

File:
1 edited

Legend:

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

    r16183 r16184  
    174174
    175175        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    176         self.slip_path = self.view_path + '/application_slip.pdf'
    177176        self.browser.open(self.manage_path)
    178177        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     
    294293        print "Sample ictwk_application_slip.pdf written to %s" % path
    295294
    296     def test_transcript_payment(self):
     295    def test_transcript_application(self):
    297296        configuration = CustomSessionConfiguration()
    298297        configuration.academic_session = session_1
     
    308307        applicantscontainer.mode = 'create'
    309308        applicantscontainer.strict_deadline = True
    310         applicantscontainer.with_picture = False
     309        applicantscontainer.with_picture = True
    311310        delta = datetime.timedelta(days=10)
    312311        applicantscontainer.startdate = datetime.datetime.now(pytz.utc) - delta
     
    337336        self.browser.getControl(name="form.course_studied").value = ['CERT1']
    338337        self.browser.getControl(name="form.matric_number").value = '234'
    339         self.browser.getControl(name="form.dispatch_address").value = 'Kuensche'
     338        self.browser.getControl(name="form.dispatch_address").value = 'Kuensche\nMarsch 5'
    340339        self.browser.getControl(name="form.entry_mode").value = ['ug_ft']
    341340        self.browser.getControl(name="form.entry_session").value = ['2014']
     
    344343        self.browser.getControl(name="form.phone.ext").value = '5678'
    345344        self.browser.getControl(name="form.charge").value = ['nigeria']
     345        image = open(SAMPLE_IMAGE, 'rb')
     346        ctrl = self.browser.getControl(name='form.passport')
     347        file_ctrl = ctrl.mech_control
     348        file_ctrl.add_file(image, filename='myphoto.jpg')
    346349        self.browser.getControl("Save").click()
    347350        self.browser.getControl("Add online payment ticket").click()
     
    349352        self.assertTrue('<span>40000.0</span>' in self.browser.contents)
    350353        self.assertEqual(applicant.values()[0].amount_auth, 40000.0)
     354        IWorkflowState(applicant).setState('submitted')
     355        self.browser.getLink("My Data").click()
     356        self.browser.getLink("Download application slip").click()
     357        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     358        self.assertEqual(self.browser.headers['Content-Type'],
     359                         'application/pdf')
     360        path = os.path.join(samples_dir(), 'tscf_application_slip.pdf')
     361        open(path, 'wb').write(self.browser.contents)
     362        print "Sample tscf_application_slip.pdf written to %s" % path
    351363        return
Note: See TracChangeset for help on using the changeset viewer.