Ignore:
Timestamp:
4 Jun 2013, 16:16:24 (11 years ago)
Author:
Henrik Bettermann
Message:

Rename credentials form.

Extend interface: add post primary qualification select box.

File:
1 edited

Legend:

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

    r10224 r10275  
    252252        self.assertTrue(fd is None)
    253253
    254     def test_upload_credentialform_by_manager(self):
     254    def test_upload_credentials_by_manager(self):
    255255        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    256256        self.browser.open(self.manage_path)
     
    258258        pdf_content = 'A' * 1024 * 300  # A string of 300 KB size
    259259        pseudo_pdf = StringIO(pdf_content)
    260         # This is a ug applicant, thus the credential form is not
     260        # This is a ug applicant, thus the credentials is not
    261261        # required
    262         self.assertFalse('credentialform">' in self.browser.contents)
     262        self.assertFalse('credentials">' in self.browser.contents)
    263263
    264264        # We have to add a pg applicants container
     
    288288
    289289        self.browser.open(self.manage_path_pg)
    290         ctrl = self.browser.getControl(name='form.credentialform')
    291         file_ctrl = ctrl.mech_control
    292         file_ctrl.add_file(pseudo_pdf, filename='myform.pdf')
    293         self.browser.getControl("Save").click() # submit form
    294         # Even though the form could not be saved ...
    295         self.assertTrue('Required input is missing' in self.browser.contents)
    296         # ... the file has been successfully uploaded
    297         pdf_url = self.manage_path_pg.replace('manage', 'credentialform.pdf')
     290        ctrl = self.browser.getControl(name='form.credentials')
     291        file_ctrl = ctrl.mech_control
     292        file_ctrl.add_file(pseudo_pdf, filename='myform.pdf')
     293        self.browser.getControl("Save").click() # submit form
     294        # Even though the form could not be saved ...
     295        self.assertTrue('Required input is missing' in self.browser.contents)
     296        # ... the file has been successfully uploaded
     297        pdf_url = self.manage_path_pg.replace('manage', 'credentials.pdf')
    298298        self.browser.open(pdf_url)
    299299        self.assertEqual(
     
    303303        storage = getUtility(IExtFileStore)
    304304        file_id = IFileStoreNameChooser(applicant).chooseName(
    305             attr='credentialform.pdf')
     305            attr='credentials.pdf')
    306306        # The stored file can be fetched
    307307        fd = storage.getFile(file_id)
     
    310310        # A file link is displayed on the edit view ...
    311311        self.browser.open(self.manage_path_pg)
    312         self.assertTrue('<a href="credentialform.pdf">' in self.browser.contents)
     312        self.assertTrue('<a href="credentials.pdf">' in self.browser.contents)
    313313        # ... and on the dislay view
    314314        self.browser.open(self.view_path_pg)
    315         self.assertTrue('<a href="credentialform.pdf">Credential Form</a>'
     315        self.assertTrue('<a href="credentials.pdf">Credentials</a>'
    316316            in self.browser.contents)
    317317        # Adding file is properly logged
     
    321321        self.assertTrue(
    322322            'zope.mgr - waeup.futminna.applicants.browser.CustomApplicantManageFormPage'
    323             ' - %s - saved: credentialform'
     323            ' - %s - saved: credentials'
    324324            % (applicant.applicant_id)
    325325            in logcontent)
Note: See TracChangeset for help on using the changeset viewer.