Ignore:
Timestamp:
18 Nov 2013, 12:24:51 (11 years ago)
Author:
Henrik Bettermann
Message:

Allow students in state cleared to upload a passport picture.

Location:
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py

    r10739 r10756  
    330330            name='upload_passportuploadedit').click()
    331331        self.browser.open(self.student_path + '/start_clearance')
    332         # In Okene the students can just start clearance without entering
     332        # In KwaraPoly the students can just start clearance without entering
    333333        # an activation code.
    334334        self.browser.getControl("Start clearance now").click()
    335335        self.assertMatches('...Clearance process has been started...',
    336336                           self.browser.contents)
     337
     338    def test_change_passport(self):
     339        self.browser.open(self.login_path)
     340        self.browser.getControl(name="form.login").value = self.student_id
     341        self.browser.getControl(name="form.password").value = 'spwd'
     342        self.browser.getControl("Login").click()
     343
     344        IWorkflowState(self.student).setState('cleared')
     345        self.browser.open(self.student_path + '/change_portrait')
     346        image = open(SAMPLE_IMAGE, 'rb')
     347        ctrl = self.browser.getControl(name='passportuploadedit')
     348        file_ctrl = ctrl.mech_control
     349        file_ctrl.add_file(image, filename='my_photo.jpg')
     350        self.browser.getControl(
     351            name='upload_passportuploadedit').click()
     352
    337353
    338354    def test_student_accommodation(self):
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/utils.py

    r10739 r10756  
    298298        return d
    299299
    300     PWCHANGE_STATES = (ADMITTED, RETURNING)
     300    PWCHANGE_STATES = (ADMITTED, CLEARED, RETURNING)
    301301
    302302    # KwaraPoly prefix
Note: See TracChangeset for help on using the changeset viewer.