Changeset 6938


Ignore:
Timestamp:
25 Oct 2011, 05:41:34 (13 years ago)
Author:
Henrik Bettermann
Message:

Add tests.

File:
1 edited

Legend:

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

    r6935 r6938  
    563563        # Students can access their own objects
    564564        # and can perform actions
    565         student = self.app['students'][self.student_id]
    566         IWorkflowInfo(student).fireTransition('admit')
     565        IWorkflowInfo(self.student).fireTransition('admit')
    567566        self.browser.open(self.login_path)
    568567        self.browser.getControl(name="form.login").value = self.student_id
     
    614613                           self.browser.contents)
    615614        # ... and must be transferred first
    616         IWorkflowInfo(student).fireTransition('clear')
    617         IWorkflowInfo(student).fireTransition('pay_first_school_fee')
     615        IWorkflowInfo(self.student).fireTransition('clear')
     616        IWorkflowInfo(self.student).fireTransition('pay_first_school_fee')
    618617        # Now students can add the current study level
    619618        self.browser.getLink("Study Course").click()
     
    654653
    655654    def test_manage_payments(self):
    656 
    657655        # Set up SessionConfiguration object
    658656        configuration = SessionConfiguration()
     
    693691
    694692        # Managers can open the callback view which simulates a valid callback
     693        self.assertEqual(len(self.app['accesscodes']['CLR-0']),0)
    695694        ctrl = self.browser.getControl(name='val_id')
    696695        value = ctrl.options[0]
     
    702701        </td>...'''
    703702        self.assertMatches(expected,self.browser.contents)
     703        # The new CLR-0 pin has been created
     704        self.assertEqual(len(self.app['accesscodes']['CLR-0']),1)
     705        pin = self.app['accesscodes']['CLR-0'].keys()[0]
     706        ac = self.app['accesscodes']['CLR-0'][pin]
     707        ac.owner = self.student_id
     708        # The new CLR-0 pin can be used for starting clearance
     709        IWorkflowInfo(self.student).fireTransition('admit')
     710        self.browser.open(self.student_path + '/start_clearance')
     711        parts = pin.split('-')[1:]
     712        clrseries, clrnumber = parts
     713        self.browser.getControl(name="ac_series").value = clrseries
     714        self.browser.getControl(name="ac_number").value = clrnumber
     715        self.browser.getControl("Start clearance now").click()
     716        self.assertMatches('...Clearance process has been started...',
     717                           self.browser.contents)
     718
Note: See TracChangeset for help on using the changeset viewer.