Changeset 7412 for main/waeup.sirp


Ignore:
Timestamp:
21 Dec 2011, 06:15:12 (13 years ago)
Author:
Henrik Bettermann
Message:

Catch AttributeError? if passport picture doesn't exist. Students can be created without passport picture.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/applicants
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicant.py

    r7409 r7412  
    136136        stud_file_id = IFileStoreNameChooser(student).chooseName(
    137137            attr="passport.jpg")
    138         file_store.createFile(stud_file_id, appl_file)
     138        try:
     139            file_store.createFile(stud_file_id, appl_file)
     140        except AttributeError:
     141            # Pass if passport picture doesn't exist
     142            pass
    139143        return
    140144
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_applicantcopier.py

    r7397 r7412  
    9191        self.assertEqual(self.browser.headers['Content-Type'],
    9292                         'application/pdf')
     93
     94    def test_copier_wo_passport(self):
     95        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     96        self.browser.open(self.manage_path)
     97        self.fill_correct_values()
     98        # Let's try to create the student
     99        IWorkflowInfo(self.applicant).fireTransition('start')
     100        IWorkflowInfo(self.applicant).fireTransition('pay')
     101        IWorkflowInfo(self.applicant).fireTransition('submit')
     102        IWorkflowInfo(self.applicant).fireTransition('admit')
     103        self.browser.getControl(name="form.course_admitted").value = ['CERT1']
     104        self.browser.getControl("Save").click()
     105        (success, msg) = self.applicant.createStudent()
     106        self.assertTrue('created' in msg)
Note: See TracChangeset for help on using the changeset viewer.