Ignore:
Timestamp:
25 Oct 2012, 09:44:02 (12 years ago)
Author:
Henrik Bettermann
Message:

Reorganize allocation of students to beds. We can't use the StudentSource? in live systems. The select box would be filled with ten thousands of students.

File:
1 edited

Legend:

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

    r9283 r9414  
    313313        self.assertMatches(
    314314          '...No allocated bed selected...', self.browser.contents)
    315         # Managers can manually allocate students after cancellation
     315        # Managers can manually allocate eligible students after cancellation
    316316        self.browser.open(self.container_path + '/hall-1/hall-1_A_101_A')
    317         self.browser.getControl(name="form.owner").value = [self.student_id]
     317        self.browser.getControl(name="form.owner").value = 'nonsense'
     318        self.browser.getControl("Save").click()
     319        self.assertMatches(
     320            "...Either student does not exist or is not in accommodation session...",
     321            self.browser.contents)
     322        self.browser.getControl(name="form.owner").value = self.student_id
    318323        self.browser.getControl("Save").click()
    319324        self.assertMatches("...Form has been saved...", self.browser.contents)
     325        # Students can only be allocated once
     326        self.browser.open(self.container_path + '/hall-1/hall-1_A_101_B')
     327        self.browser.getControl(name="form.owner").value = self.student_id
     328        self.browser.getControl("Save").click()
     329        self.assertMatches(
     330            "...This student resides in bed hall-1_A_101_A...",
     331            self.browser.contents)
    320332        # If we open the same form again, we will be redirected to hostel
    321333        # manage page. Beds must be released first before they can be
     
    347359        # Also the number of the bed has changed.
    348360        self.assertFalse(new_number == old_number)
    349         # The number of occupied bed are displayed on container page.
     361        # The number of occupied beds are displayed on container page.
    350362        self.browser.open(self.container_path)
    351363        self.assertTrue('1 of 8' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.