Index: /main/waeup.sirp/trunk/src/waeup/sirp/hostels/tests.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/hostels/tests.py	(revision 7044)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/hostels/tests.py	(revision 7045)
@@ -34,4 +34,6 @@
 from waeup.sirp.hostels.hostel import Hostel, Bed
 from waeup.sirp.testing import (FunctionalLayer, FunctionalTestCase)
+from waeup.sirp.students.student import Student
+from waeup.sirp.students.accommodation import BedTicket
 
 class HostelsContainerTestCase(FunctionalTestCase):
@@ -95,4 +97,19 @@
         setSite(app)
 
+        # Add student with subobjects
+        student = Student()
+        student.fullname = u'Anna Tester'
+        student.reg_number = u'123'
+        student.matric_number = u'234'
+        student.sex = u'f'
+        self.app['students'].addStudent(student)
+        self.student_id = student.student_id
+        self.student = self.app['students'][self.student_id]
+        self.student['studycourse'].current_session = 2004
+        self.student['studycourse'].entry_session = 2004
+
+        # Set accommodation_session
+        self.app['configuration'].accommodation_session = 2004
+
         # Create a hostel
         hostel = Hostel()
@@ -126,5 +143,5 @@
 
     def test_get_catalog(self):
-        # We can get an students catalog if we wish
+        # We can get a beds catalog if we wish
         cat = queryUtility(ICatalog, name='beds_catalog')
         assert cat is not None
@@ -244,4 +261,19 @@
             'hall-1_A_101_D'].bed_type == 'regular_female_all'
         self.assertFalse(expected in self.browser.contents)
+        # Release bed which has previously been booked
+        bedticket = BedTicket()
+        bedticket.ticket_id = u'2004'
+        bedticket.bed_coordinates = u'anything'
+        self.student['accommodation'].addBedTicket(bedticket)
+        self.app['hostels']['hall-1']['hall-1_A_101_D'].owner = self.student_id
+        self.browser.open(self.container_path + '/hall-1/manage')
+        ctrl = self.browser.getControl(name='val_id')
+        ctrl.getControl(value='hall-1_A_101_D').selected = True
+        self.browser.getControl("Release selected beds", index=0).click()
+        self.assertMatches(
+          '...Successfully released beds: hall-1_A_101_D (%s)...' % self.student_id,
+          self.browser.contents)
+        self.assertMatches(bedticket.bed_coordinates,
+          u' -- booking cancelled on <YYYY-MM-DD hh:mm:ss> --')
         # Remove entire hostel
         self.browser.open(self.manage_container_path)
