Ignore:
Timestamp:
22 Jul 2012, 05:07:30 (12 years ago)
Author:
Henrik Bettermann
Message:

Test dataNotComplete and take required nationality field into consideration.

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

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/sample_student_data.csv

    r8862 r9041  
    1 firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,sex
    2 Aaren,Pieri,1,,100000,aa@aa.ng,1234,m
    3 Aaren,Finau,2,,100001,aa@aa.ng,1234,m
    4 Aaren,Berson,3,,100002,aa@aa.ng,1234,m
     1firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,sex,nationality
     2Aaren,Pieri,1,,100000,aa@aa.ng,1234,m,DE
     3Aaren,Finau,2,,100001,aa@aa.ng,1234,m,NG
     4Aaren,Berson,3,,100002,aa@aa.ng,1234,m,FR
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_browser.py

    r8863 r9041  
    2020import tempfile
    2121from StringIO import StringIO
    22 from hurry.workflow.interfaces import IWorkflowState
     22from hurry.workflow.interfaces import IWorkflowState, IWorkflowInfo
    2323from zope.component.hooks import setSite, clearSite
    2424from zope.component import getUtility, createObject
     
    105105    layer = FunctionalLayer
    106106
     107    def setUp(self):
     108        super(StudentUITests, self).setUp()
     109        self.student.nationality = u'DE'
     110
    107111    def test_classes(self):
    108112        # Let's see if objects created in the customized
     
    184188        # Students can edit clearance data
    185189        IWorkflowState(self.student).setState('cleared')
    186         self.student.clearance_locked = False
    187190        self.browser.open(self.login_path)
    188191        self.browser.getControl(name="form.login").value = self.student_id
     
    203206        self.browser.open(self.student_path + '/change_portrait')
    204207        self.assertTrue('The requested form is locked' in self.browser.contents)
    205         # Student can view and edit clearance data
     208
     209        # Student can view and edit clearance data if clearance has started
     210        IWorkflowInfo(self.student).fireTransition('start_clearance')
    206211        self.browser.getLink("Clearance Data").click()
    207212        self.browser.getLink("Edit").click()
    208213        self.assertTrue('Save' in self.browser.contents)
     214
     215        # Clearance can only be requested if all required documents
     216        # have been uploaded.
     217        self.browser.getControl("Save and request clearance").click()
     218        self.assertTrue('No birth certificate uploaded' in self.browser.contents)
     219        birth_certificate = 'My birth certificate'
     220        file_id = IFileStoreNameChooser(self.student).chooseName(
     221            attr="birth_certificate.jpg")
     222        file_store.createFile(file_id, StringIO(birth_certificate))
     223        self.browser.open(self.edit_clearance_path)
     224        self.browser.getControl("Save and request clearance").click()
     225
     226        self.assertTrue('No referee letter uploaded' in self.browser.contents)
     227        ref_let = 'My ref let'
     228        file_id = IFileStoreNameChooser(self.student).chooseName(
     229            attr="ref_let.jpg")
     230        file_store.createFile(file_id, StringIO(ref_let))
     231        self.browser.open(self.edit_clearance_path)
     232        self.browser.getControl("Save and request clearance").click()
     233
     234        self.assertTrue('No acceptance letter uploaded' in self.browser.contents)
     235        acc_let = 'My acc let'
     236        file_id = IFileStoreNameChooser(self.student).chooseName(
     237            attr="acc_let.jpg")
     238        file_store.createFile(file_id, StringIO(acc_let))
     239        self.browser.open(self.edit_clearance_path)
     240        self.browser.getControl("Save and request clearance").click()
     241
     242        self.assertTrue('No first sitting result uploaded' in self.browser.contents)
     243        fst_sit_scan = 'My first sitting result'
     244        file_id = IFileStoreNameChooser(self.student).chooseName(
     245            attr="fst_sit_scan.jpg")
     246        file_store.createFile(file_id, StringIO(fst_sit_scan))
     247        self.browser.open(self.edit_clearance_path)
     248        self.browser.getControl("Save and request clearance").click()
     249        self.assertTrue('Enter the CLR access code used for starting clearance'
     250            in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.