Ignore:
Timestamp:
9 Nov 2011, 10:30:30 (13 years ago)
Author:
Henrik Bettermann
Message:

Add 'Request callback' button.

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

Legend:

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

    r7042 r7056  
    10221022        return self.view.url(self.view.context, self.target)
    10231023
     1024class RequestCallbackActionButton(ManageActionButton):
     1025    grok.order(2)
     1026    grok.context(IStudentOnlinePayment)
     1027    grok.view(OnlinePaymentDisplayFormPage)
     1028    grok.require('waeup.handleStudent')
     1029    icon = 'actionicon_call.png'
     1030    text = 'Request callback'
     1031    target = 'callback'
     1032
     1033    @property
     1034    def target_url(self):
     1035        if self.context.p_state != 'unpaid':
     1036            return ''
     1037        return self.view.url(self.view.context, self.target)
     1038
    10241039class OnlinePaymentCallbackPage(grok.View):
    10251040    """ Callback view
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py

    r7030 r7056  
    723723        # Managers can open the callback view which simulates a valid callback
    724724        self.assertEqual(len(self.app['accesscodes']['SFE-0']),0)
    725         self.browser.open(payment_url + '/callback')
     725        self.browser.open(payment_url)
     726        self.browser.getLink("Request callback").click()
    726727        self.assertMatches('...Valid callback received...',
    727728                          self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.