Ignore:
Timestamp:
22 Oct 2012, 05:16:08 (12 years ago)
Author:
Henrik Bettermann
Message:

Required scans have to be customized in the institution packages.

Location:
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/browser.py

    r9376 r9378  
    145145        return form_fields
    146146
    147     def dataNotComplete(self):
    148         store = getUtility(IExtFileStore)
    149         if not store.getFileByContext(self.context, attr=u'birth_certificate.jpg'):
    150             return _('No birth certificate uploaded.')
    151         if not store.getFileByContext(self.context, attr=u'ref_let.jpg'):
    152             return _('No referee letter uploaded.')
    153         if not store.getFileByContext(self.context, attr=u'acc_let.jpg'):
    154             return _('No acceptance letter uploaded.')
    155         if not store.getFileByContext(self.context, attr=u'fst_sit_scan.jpg'):
    156             return _('No first sitting result uploaded.')
    157         return False
    158 
    159147class NigeriaExportPDFCourseRegistrationSlipPage(ExportPDFCourseRegistrationSlipPage):
    160148    """Deliver a PDF slip of the context.
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_browser.py

    r9356 r9378  
    214214        self.assertTrue('Save' in self.browser.contents)
    215215
    216         # Clearance can only be requested if all required documents
    217         # have been uploaded.
    218         self.browser.getControl("Save and request clearance").click()
    219         self.assertTrue('No birth certificate uploaded' in self.browser.contents)
    220         birth_certificate = 'My birth certificate'
    221         file_id = IFileStoreNameChooser(self.student).chooseName(
    222             attr="birth_certificate.jpg")
    223         file_store.createFile(file_id, StringIO(birth_certificate))
    224         self.browser.open(self.edit_clearance_path)
    225         self.browser.getControl("Save and request clearance").click()
    226 
    227         self.assertTrue('No referee letter uploaded' in self.browser.contents)
    228         ref_let = 'My ref let'
    229         file_id = IFileStoreNameChooser(self.student).chooseName(
    230             attr="ref_let.jpg")
    231         file_store.createFile(file_id, StringIO(ref_let))
    232         self.browser.open(self.edit_clearance_path)
    233         self.browser.getControl("Save and request clearance").click()
    234 
    235         self.assertTrue('No acceptance letter uploaded' in self.browser.contents)
    236         acc_let = 'My acc let'
    237         file_id = IFileStoreNameChooser(self.student).chooseName(
    238             attr="acc_let.jpg")
    239         file_store.createFile(file_id, StringIO(acc_let))
    240         self.browser.open(self.edit_clearance_path)
    241         self.browser.getControl("Save and request clearance").click()
    242 
    243         self.assertTrue('No first sitting result uploaded' in self.browser.contents)
    244         fst_sit_scan = 'My first sitting result'
    245         file_id = IFileStoreNameChooser(self.student).chooseName(
    246             attr="fst_sit_scan.jpg")
    247         file_store.createFile(file_id, StringIO(fst_sit_scan))
    248         self.browser.open(self.edit_clearance_path)
    249         self.browser.getControl("Save and request clearance").click()
    250         self.assertTrue('Clearance has been requested'
    251             in self.browser.contents)
    252 
    253216    def test_manage_upload_file(self):
    254217        # Managers can upload a file via the StudentClearanceManageFormPage
Note: See TracChangeset for help on using the changeset viewer.