Index: /main/waeup.kofa/trunk/docs/source/userdocs/hostels.rst
===================================================================
--- /main/waeup.kofa/trunk/docs/source/userdocs/hostels.rst	(revision 13175)
+++ /main/waeup.kofa/trunk/docs/source/userdocs/hostels.rst	(revision 13176)
@@ -156,6 +156,12 @@
 another bed.
 
+.. _hostels_pages:
+
 Browser Pages
 =============
+
+.. seealso::
+
+   :ref:`Manage Hostel Python Test <test_manage_hostels>`
 
 Update Beds
Index: /main/waeup.kofa/trunk/docs/source/userdocs/testing.rst
===================================================================
--- /main/waeup.kofa/trunk/docs/source/userdocs/testing.rst	(revision 13175)
+++ /main/waeup.kofa/trunk/docs/source/userdocs/testing.rst	(revision 13176)
@@ -226,4 +226,15 @@
    :pyobject: test_handle_courses_by_lecturer
 
+.. _test_manage_hostels:
+
+Manage Hostel
+-------------
+
+This test can be found in
+`waeup.kofa.hostels.tests.HostelsUITests`. The corresponding use
+case is described :ref:`elsewhere <hostels_pages>`.
+
+.. literalinclude:: ../../../src/waeup/kofa/hostels/tests.py
+   :pyobject: test_add_search_edit_delete_manage_hostels
 
 .. _test_handle_accommodation:
Index: /main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py	(revision 13175)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py	(revision 13176)
@@ -239,5 +239,5 @@
         # Since the testbrowser does not support Javascrip the
         # save action cleared the settings above and we have to set them
-        # again
+        # again.
         self.assertTrue(len(hall.blocks_for_female) == 0)
         hall.blocks_for_female = ['A','B']
@@ -258,6 +258,5 @@
              (u'hall-1_B_101_D', u'regular_female_all'),
              (u'hall-1_B_101_E', u'regular_female_all')])
-
-        # Reserve bed
+        # Reserve beds.
         self.browser.getControl("Switch reservation", index=0).click()
         self.assertTrue('No item selected' in self.browser.contents)
@@ -273,5 +272,5 @@
             'hall-1_A_101_D'].bed_type, 'regular_female_reserved')
         self.assertTrue('A_101_A&nbsp;&nbsp;' in self.browser.contents)
-        # The catalog has been updated
+        # The catalog has been updated.
         results = cat.searchResults(
             bed_type=('regular_female_all', 'regular_female_all'))
@@ -289,6 +288,5 @@
              (u'hall-1_A_101_C', u'regular_female_reserved'),
              (u'hall-1_A_101_D', u'regular_female_reserved')])
-
-        # Change hostel configuration with one bed booked
+        # Change hostel configuration with one bed booked.
         hall['hall-1_A_101_E'].owner = u'anyid'
         notify(grok.ObjectModifiedEvent(hall['hall-1_A_101_E']))
@@ -298,5 +296,5 @@
         expected = '...9 empty beds removed, 9 beds added, 1 occupied beds modified...'
         self.assertMatches(expected,self.browser.contents)
-        # Updating beds (including booked beds!) does update catalog
+        # Updating beds (including booked beds!) does update catalog.
         results = cat.searchResults(
             bed_type=('regular_female_all', 'regular_female_all'))
@@ -304,5 +302,5 @@
         self.assertEqual(results,
             [(u'hall-1_B_101_D', u'regular_female_all'),])
-        # Unreserve bed
+        # Unreserve beds.
         ctrl = self.browser.getControl(name='val_id')
         ctrl.getControl(value='hall-1_A_101_A').selected = True
@@ -314,5 +312,5 @@
             'hall-1_A_101_D'].bed_type == 'regular_female_all'
         self.assertFalse(expected in self.browser.contents)
-        # Release bed which has previously been booked
+        # Release bed which has previously been booked.
         bedticket = BedTicket()
         bedticket.booking_session = 2004
@@ -332,5 +330,5 @@
         self.assertMatches(bedticket.bed_coordinates,
           u' -- booking cancelled on <YYYY-MM-DD hh:mm:ss> UTC --')
-        # If we release a free be, nothing will happen
+        # If we release a free be, nothing will happen.
         ctrl = self.browser.getControl(name='val_id')
         ctrl.getControl(value='hall-1_A_101_D').selected = True
@@ -338,12 +336,12 @@
         self.assertMatches(
           '...No allocated bed selected...', self.browser.contents)
-        # Managers can manually allocate eligible students after cancellation
+        # Managers can manually allocate eligible students after cancellation.
         self.browser.open(self.container_path + '/hall-1/hall-1_A_101_A')
-        # 'not occupied' is not accepted
+        # 'not occupied' is not accepted.
         self.browser.getControl("Save").click()
         self.assertMatches(
             "...No valid student id...",
             self.browser.contents)
-        # Invalid student ids are not accepted
+        # Invalid student ids are not accepted.
         self.browser.getControl(name="form.owner").value = 'nonsense'
         self.browser.getControl("Save").click()
@@ -355,5 +353,5 @@
         self.browser.getControl("Save").click()
         self.assertMatches("...Form has been saved...", self.browser.contents)
-        # Students can only be allocated once
+        # Students can only be allocated once.
         self.browser.open(self.container_path + '/hall-1/hall-1_A_101_B')
         self.browser.getControl(name="form.owner").value = self.student_id
@@ -369,10 +367,10 @@
             self.container_path + '/hall-1/@@manage#tab2')
         # Updating the beds again will not affect the allocation and also
-        # the bed numbering remains the same
+        # the bed numbering remains the same.
         old_number = self.app['hostels']['hall-1']['hall-1_A_101_A'].bed_number
         old_owner = self.app['hostels']['hall-1']['hall-1_A_101_A'].owner
         self.browser.getControl("Update all beds").click()
         # 8 beds have been removed and re-added, 2 beds remains untouched
-        # because they are occupied
+        # because they are occupied.
         expected = '...8 empty beds removed, 8 beds added, 0 occupied beds modified...'
         self.assertMatches(expected,self.browser.contents)
@@ -382,5 +380,5 @@
         self.assertEqual(new_owner, old_owner)
         # If we change the bed type of an allocated bed, the modification will
-        # be indicated
+        # be indicated.
         hall.blocks_for_female = ['B']
         hall.blocks_for_male = ['A']
@@ -395,5 +393,5 @@
         self.browser.open(self.container_path)
         self.assertTrue('2 of 10' in self.browser.contents)
-        # Remove entire hostel
+        # Remove entire hostel.
         self.browser.open(self.manage_container_path)
         ctrl = self.browser.getControl(name='val_id')
@@ -402,5 +400,5 @@
         self.browser.getControl("Remove selected", index=0).click()
         self.assertTrue('Successfully removed' in self.browser.contents)
-        # Catalog is empty
+        # Catalog is empty.
         results = cat.searchResults(
             bed_type=('regular_female_all', 'regular_female_all'))
