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

Much more logic for bed allocation, bed release.

Implement student relocation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/hostels/tests.py

    r7045 r7068  
    108108        self.student['studycourse'].current_session = 2004
    109109        self.student['studycourse'].entry_session = 2004
     110        # The students_catalog must be informed that the
     111        # session attribute has changed
     112        notify(grok.ObjectModifiedEvent(self.student))
    110113
    111114        # Set accommodation_session
     
    125128
    126129        self.container_path = 'http://localhost/app/hostels'
     130        self.student_path = 'http://localhost/app/students/%s' % self.student_id
    127131        self.manage_container_path = self.container_path + '/@@manage'
    128132        self.add_hostel_path = self.container_path + '/addhostel'
     
    269273        self.browser.open(self.container_path + '/hall-1/manage')
    270274        ctrl = self.browser.getControl(name='val_id')
     275        self.browser.getControl("Release selected beds", index=0).click()
     276        self.assertMatches("...No item selected...", self.browser.contents)
     277        ctrl = self.browser.getControl(name='val_id')
    271278        ctrl.getControl(value='hall-1_A_101_D').selected = True
    272279        self.browser.getControl("Release selected beds", index=0).click()
     
    276283        self.assertMatches(bedticket.bed_coordinates,
    277284          u' -- booking cancelled on <YYYY-MM-DD hh:mm:ss> --')
     285        # Managers can manually allocate studenst after cancellation
     286        self.browser.open(self.container_path + '/hall-1/hall-1_A_101_A')
     287        self.browser.getControl(name="form.owner").value = [self.student_id]
     288        self.browser.getControl("Save").click()
     289        self.assertMatches("...Form has been saved...", self.browser.contents)
    278290        # Remove entire hostel
    279291        self.browser.open(self.manage_container_path)
Note: See TracChangeset for help on using the changeset viewer.