Ignore:
Timestamp:
28 Oct 2016, 08:24:50 (8 years ago)
Author:
Henrik Bettermann
Message:

Fix checkAccommodationRequirements.

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

    r14227 r14238  
    3232from zope.catalog.interfaces import ICatalog
    3333from waeup.kofa.app import University
    34 from waeup.kofa.interfaces import VALIDATED
     34from waeup.kofa.interfaces import VALIDATED, PAID
    3535from waeup.kofa.students.tests.test_browser import StudentsFullSetup
    3636from waeup.kofa.students.accommodation import BedTicket
     
    796796            in self.browser.contents)
    797797        self.student['studycourse'].certificate.study_mode = 'ug_ft'
     798        self.app['hostels'].accommodation_states = [PAID]
     799        self.browser.getControl("Book accommodation").click()
     800        self.assertTrue(
     801            'You are in the wrong registration state.'
     802            in self.browser.contents)
     803        IWorkflowState(self.student).setState(PAID)
    798804        self.browser.getControl("Book accommodation").click()
    799805        self.assertFalse('Activation Code:' in self.browser.contents)
  • main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py

    r14236 r14238  
    391391
    392392    def checkAccommodationRequirements(self, student, acc_details):
    393         super(CustomStudentsUtils, self).checkAccommodationRequirements(
     393        msg = super(CustomStudentsUtils, self).checkAccommodationRequirements(
    394394            student, acc_details)
     395        if msg:
     396            return msg
    395397        if student.current_mode not in ('ug_ft', 'de_ft', 'mug_ft', 'mde_ft'):
    396398            return _('You are not eligible to book accommodation.')
Note: See TracChangeset for help on using the changeset viewer.