Ignore:
Timestamp:
4 Sep 2012, 11:18:20 (12 years ago)
Author:
Henrik Bettermann
Message:

Customize StartClearancePage?. In Okene the students can just start clearance without entering an activation code.

File:
1 edited

Legend:

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

    r9153 r9156  
    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
    2525from zope.interface import verify
    2626from waeup.kofa.app import University
    27 from waeup.kofa.students.tests.test_browser import StudentsFullSetup
     27from waeup.kofa.students.tests.test_browser import (
     28    StudentsFullSetup, SAMPLE_IMAGE)
    2829from waeup.kofa.testing import FunctionalTestCase
    2930from waeup.kofa.interfaces import (
     
    247248        self.assertEqual(error, u'Previous session payment not yet implemented.')
    248249        return
     250
     251    def test_student_start_clearance(self):
     252        self.browser.open(self.login_path)
     253        self.browser.getControl(name="form.login").value = self.student_id
     254        self.browser.getControl(name="form.password").value = 'spwd'
     255        self.browser.getControl("Login").click()
     256
     257        IWorkflowInfo(self.student).fireTransition('admit')
     258        self.browser.open(self.student_path + '/change_portrait')
     259        image = open(SAMPLE_IMAGE, 'rb')
     260        ctrl = self.browser.getControl(name='passportuploadedit')
     261        file_ctrl = ctrl.mech_control
     262        file_ctrl.add_file(image, filename='my_photo.jpg')
     263        self.browser.getControl(
     264            name='upload_passportuploadedit').click()
     265        self.browser.open(self.student_path + '/start_clearance')
     266        # In Okene the students can just start clearance without entering
     267        # an activation code.
     268        self.browser.getControl("Start clearance now").click()
     269        self.assertMatches('...Clearance process has been started...',
     270                           self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.