Changeset 9570 for main


Ignore:
Timestamp:
7 Nov 2012, 17:22:50 (12 years ago)
Author:
Henrik Bettermann
Message:

Disable condition: "Students are only allowed to pay for the next session if current session payment"

Location:
main/waeup.uniben/trunk/src/waeup/uniben
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py

    r9520 r9570  
    108108        self.browser.getControl(name="form.p_category").value = ['schoolfee']
    109109        self.browser.getControl("Create ticket").click()
    110         # Next session payment can't be made ...
    111         self.assertMatches(
    112             '...You have not yet paid your current/active session...',
    113             self.browser.contents)
    114         # current session payment must be approved first.
    115         self.student['payments'][current_payment_key].approve()
    116         self.browser.open(self.payments_path + '/addop')
    117         self.browser.getControl(name="form.p_category").value = ['schoolfee']
    118         self.browser.getControl("Create ticket").click()
     110
     111        ## Next session payment can't be made ...
     112        #self.assertMatches(
     113        #    '...You have not yet paid your current/active session...',
     114        #    self.browser.contents)
     115        ## current session payment must be approved first.
     116        #self.student['payments'][current_payment_key].approve()
     117        #self.browser.open(self.payments_path + '/addop')
     118        #self.browser.getControl(name="form.p_category").value = ['schoolfee']
     119        #self.browser.getControl("Create ticket").click()
     120
    119121        ctrl = self.browser.getControl(name='val_id')
    120122        value = ctrl.options[1]
  • main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py

    r9522 r9570  
    296296        self.browser.getControl(name="form.p_category").value = ['schoolfee']
    297297        self.browser.getControl("Create ticket").click()
    298         self.assertMatches('...You have not yet paid your current/active session...',
    299                            self.browser.contents)
    300         # Ok, let's pay the first schoolfee ticket.
    301         schoolfee_ticket.approve()
    302         self.browser.open(self.payments_path + '/addop')
    303         self.browser.getControl(name="form.p_category").value = ['schoolfee']
    304         self.browser.getControl("Create ticket").click()
     298
     299
     300        #self.assertMatches('...You have not yet paid your current/active session...',
     301        #                   self.browser.contents)
     302        ## Ok, let's pay the first schoolfee ticket.
     303        #schoolfee_ticket.approve()
     304        #self.browser.open(self.payments_path + '/addop')
     305        #self.browser.getControl(name="form.p_category").value = ['schoolfee']
     306        #self.browser.getControl("Create ticket").click()
     307
     308
    305309        self.assertMatches('...ticket created...',
    306310                           self.browser.contents)
     
    430434
    431435        IWorkflowState(self.student).setState('returning')
    432         error, payment = utils.setPaymentDetails('schoolfee',
    433             self.student, None, None)
    434         self.assertTrue(
    435             u'You have not yet paid your current/active session.' in error)
    436         # Ok, that means we have to add paid payment ticket first.
    437         payment = createObject('waeup.StudentOnlinePayment')
    438         payment.p_category = u'schoolfee'
    439         payment.p_session = self.student.current_session
    440         payment.p_item = u'My Certificate'
    441         payment.p_id = u'anyid'
    442         payment.p_state = u'paid'
    443         self.student['payments']['anykey'] = payment
     436
     437
     438        #error, payment = utils.setPaymentDetails('schoolfee',
     439        #    self.student, None, None)
     440        #self.assertTrue(
     441        #    u'You have not yet paid your current/active session.' in error)
     442        ## Ok, that means we have to add paid payment ticket first.
     443        #payment = createObject('waeup.StudentOnlinePayment')
     444        #payment.p_category = u'schoolfee'
     445        #payment.p_session = self.student.current_session
     446        #payment.p_item = u'My Certificate'
     447        #payment.p_id = u'anyid'
     448        #payment.p_state = u'paid'
     449        #self.student['payments']['anykey'] = payment
     450
     451
    444452        error, payment = utils.setPaymentDetails('schoolfee',
    445453            self.student, None, None)
  • main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py

    r9551 r9570  
    146146                    if academic_session == None:
    147147                        return _(u'Session configuration object is not available.'), None
     148
    148149                    # Students are only allowed to pay for the next session
    149150                    # if current session payment
    150151                    # has really been made, i.e. payment object exists.
    151                     if not self._paymentMade(
    152                         student, student.current_session):
    153                         return _('You have not yet paid your current/active' +
    154                                  ' session. Please use the previous session' +
    155                                  ' payment form first.'), None
     152                    #if not self._paymentMade(
     153                    #    student, student.current_session):
     154                    #    return _('You have not yet paid your current/active' +
     155                    #             ' session. Please use the previous session' +
     156                    #             ' payment form first.'), None
     157
    156158                    if student.is_foreigner:
    157159                        amount = getattr(certificate, 'school_fee_4', 0.0)
     
    166168                    if academic_session == None:
    167169                        return _(u'Session configuration object is not available.'), None
     170
    168171                    # Students are only allowed to pay for the next session
    169172                    # if current session payment has really been made,
    170173                    # i.e. payment object exists and is paid.
    171                     if not self._paymentMade(
    172                         student, student.current_session):
    173                         return _('You have not yet paid your current/active' +
    174                                  ' session. Please use the previous session' +
    175                                  ' payment form first.'), None
     174                    #if not self._paymentMade(
     175                    #    student, student.current_session):
     176                    #    return _('You have not yet paid your current/active' +
     177                    #             ' session. Please use the previous session' +
     178                    #             ' payment form first.'), None
     179
    176180                    if student.is_foreigner:
    177181                        amount = getattr(certificate, 'school_fee_4', 0.0)
Note: See TracChangeset for help on using the changeset viewer.