Ignore:
Timestamp:
14 Mar 2012, 21:38:43 (13 years ago)
Author:
Henrik Bettermann
Message:

Add browser test for InterswitchForm?.

File:
1 edited

Legend:

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

    r7879 r7886  
    1919import shutil
    2020import tempfile
     21from hurry.workflow.interfaces import IWorkflowState
    2122from zope.component.hooks import setSite, clearSite
    2223from waeup.kofa.app import University
     
    108109        self.assertMatches('...Amount could not be determined...',
    109110                           self.browser.contents)
    110         self.browser.open(self.manage_student_path)
    111         self.browser.getControl(name="transition").value = ['admit']
    112         self.browser.getControl("Save").click()
    113         self.browser.getControl(name="transition").value = ['start_clearance']
    114         self.browser.getControl("Save").click()
    115         self.browser.getControl(name="transition").value = ['request_clearance']
    116         self.browser.getControl("Save").click()
    117         self.browser.getControl(name="transition").value = ['clear']
    118         self.browser.getControl("Save").click()
     111        IWorkflowState(self.student).setState('cleared')
    119112        self.browser.open(self.payments_student_path + '/addop')
    120113        self.browser.getControl("Create ticket").click()
     
    126119        self.assertMatches('...Amount Authorized...',
    127120                           self.browser.contents)
    128         #payment_url = self.browser.url
    129         #self.browser.open(payment_url)
     121        payment_url = self.browser.url
     122       
     123        # Manager can access InterswitchForm
     124        self.browser.getLink("CollegePAY", index=0).click()
     125        self.assertMatches('...Total Amount Authorized:...',
     126                           self.browser.contents)
     127        self.assertMatches(
     128            '...<input type="hidden" name="amount" value="4000000" />...',
     129            self.browser.contents)
     130
     131        # Manager receives valid callback
     132        self.browser.open(payment_url)
    130133        self.browser.getLink("Request CollegePAY callback").click()
    131134        self.assertMatches('...Valid callback received...',
    132135                          self.browser.contents)
     136
    133137        self.browser.open(self.manage_student_path)
    134138        self.browser.getControl(
Note: See TracChangeset for help on using the changeset viewer.