Ignore:
Timestamp:
5 Jun 2015, 08:25:11 (10 years ago)
Author:
Henrik Bettermann
Message:

Activate late course registration payment.

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

Legend:

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

    r12504 r13035  
    1919import shutil
    2020import tempfile
     21import pytz
    2122import grok
     23from datetime import datetime, timedelta, date
    2224from mechanize import LinkNotFoundError
    2325from hurry.workflow.interfaces import IWorkflowState
     
    255257          'Add previous session payment ticket' in self.browser.contents)
    256258        return
     259
     260    def test_late_registration(self):
     261        # Login
     262        delta = timedelta(days=10)
     263        self.app['configuration'][
     264            '2004'].coursereg_deadline = datetime.now(pytz.utc) - delta
     265        IWorkflowState(self.student).setState('school fee paid')
     266        self.browser.open(self.login_path)
     267        self.browser.getControl(name="form.login").value = self.student_id
     268        self.browser.getControl(name="form.password").value = 'spwd'
     269        self.browser.getControl("Login").click()
     270        self.browser.open(self.payments_path)
     271        self.browser.open(self.payments_path + '/addop')
     272        self.browser.getControl(name="form.p_category").value = ['late_registration']
     273        self.browser.getControl("Create ticket").click()
     274        self.assertMatches('...ticket created...',
     275                           self.browser.contents)
     276        self.browser.open(self.payments_path)
     277        ctrl = self.browser.getControl(name='val_id')
     278        value = ctrl.options[0]
     279        self.browser.getLink("Study Course").click()
     280        self.browser.getLink("Add course list").click()
     281        self.assertMatches('...Add current level 100 (Year 1)...',
     282                           self.browser.contents)
     283        self.browser.getControl("Create course list now").click()
     284        self.browser.getLink("100").click()
     285        self.browser.getLink("Edit course list").click()
     286        self.browser.getControl("Register course list").click()
     287        self.assertTrue('Course registration has ended. Please pay' in self.browser.contents)
     288        self.student['payments'][value].approve()
     289        self.browser.getControl("Register course list").click()
     290        self.assertTrue('Course list has been registered' in self.browser.contents)
     291        self.assertEqual(self.student.state, 'courses registered')
    257292
    258293    def deactivated_test_student_course_registration(self):
  • main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py

    r12975 r13035  
    152152            p_item = student['studycourse'].certificate.code
    153153        elif category == 'late_registration':
    154             amount = academic_session.late_fee
     154            amount = academic_session.late_registration_fee
    155155        elif category == 'schoolfee':
    156156            try:
Note: See TracChangeset for help on using the changeset viewer.