Changeset 13523


Ignore:
Timestamp:
2 Dec 2015, 12:01:00 (9 years ago)
Author:
Henrik Bettermann
Message:

Disable removal of payment tickets by students.

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

Legend:

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

    r13512 r13523  
    1919from zope.i18n import translate
    2020from zope.component import getUtility
     21from zope.security import checkPermission
    2122from zope.formlib.textwidgets import BytesDisplayWidget
    2223from waeup.kofa.browser.layout import UtilityView
     
    3435    BedTicketAddPage,
    3536    StudentFilesUploadPage,
     37    PaymentsManageFormPage,
    3638    )
    3739from kofacustom.nigeria.students.browser import (
     
    126128    form_fields = grok.AutoFields(ICustomStudentOnlinePayment).select(
    127129        'p_category')
     130
     131class CustomPaymentsManageFormPage(PaymentsManageFormPage):
     132    """ Page to manage the student payments.
     133
     134    This manage form page is for both students and students officers.
     135    """
     136    @property
     137    def manage_payments_allowed(self):
     138        return checkPermission('waeup.manageStudent', self.context)
    128139
    129140class CustomExportPDFPaymentSlip(NigeriaExportPDFPaymentSlip):
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py

    r13512 r13523  
    305305        self.browser.getControl("Create ticket").click()
    306306        self.assertTrue('ticket created' in self.browser.contents)
    307         ctrl = self.browser.getControl(name='val_id')
    308         value = ctrl.options[0]
     307        value = self.student['payments'].keys()[0]
    309308        self.browser.getLink(value).click()
    310309        self.assertTrue('Amount Authorized' in self.browser.contents)
     
    322321        self.browser.getControl("Create ticket").click()
    323322        self.assertTrue('ticket created' in self.browser.contents)
    324         ctrl = self.browser.getControl(name='val_id')
    325         value = ctrl.options[1]
     323        value = self.student['payments'].keys()[1]
    326324        self.browser.getLink(value).click()
    327325        self.assertTrue('<span>My bed coordinates</span>' in self.browser.contents)
     
    348346        self.assertMatches('...ticket created...',
    349347                           self.browser.contents)
    350         self.browser.open(self.payments_path)
    351         ctrl = self.browser.getControl(name='val_id')
    352         value = ctrl.options[0]
    353348        self.browser.getLink("Study Course").click()
    354349        self.browser.getLink("Add course list").click()
     
    360355        self.browser.getControl("Register course list").click()
    361356        self.assertTrue('Course registration has ended. Please pay' in self.browser.contents)
    362         self.student['payments'][value].approve()
     357        self.student['payments'].values()[0].approve()
    363358        self.browser.getControl("Register course list").click()
    364359        self.assertTrue('Course list has been registered' in self.browser.contents)
     
    367362        # register courses.
    368363        self.student['studycourse'].entry_session = 2004
    369         del self.student['payments'][value]
     364        del self.student['payments'][self.student['payments'].keys()[0]]
    370365        IWorkflowState(self.student).setState('school fee paid')
    371366        self.browser.open(self.studycourse_path + '/100/edit')
Note: See TracChangeset for help on using the changeset viewer.