Index: /main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py	(revision 13459)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py	(revision 13460)
@@ -944,5 +944,5 @@
         # ... but not if booking period has expired ...
         self.app['hostels'].enddate = datetime.now(pytz.utc)
-        self.browser.getLink("Book accommodation").click()
+        self.browser.getControl("Book accommodation").click()
         self.assertMatches('...Outside booking period: ...',
                            self.browser.contents)
@@ -950,10 +950,10 @@
         # ... or student data are incomplete ...
         self.student['studycourse'].current_level = None
-        self.browser.getLink("Book accommodation").click()
+        self.browser.getControl("Book accommodation").click()
         self.assertMatches('...Your data are incomplete...',
             self.browser.contents)
         self.student['studycourse'].current_level = 200
         # ... or student is not the an allowed state ...
-        self.browser.getLink("Book accommodation").click()
+        self.browser.getControl("Book accommodation").click()
         self.assertMatches('...You are in the wrong...',
                            self.browser.contents)
@@ -964,9 +964,9 @@
         self.student['studycourse'].current_level = 500 # final-year
         self.student['studycourse'].current_verdict = 'C'
-        self.browser.getLink("Book accommodation").click()
+        self.browser.getControl("Book accommodation").click()
         self.assertMatches('...Your are not eligible...',
             self.browser.contents)
         self.student['studycourse'].previous_verdict = 'A'
-        self.browser.getLink("Book accommodation").click()
+        self.browser.getControl("Book accommodation").click()
         self.assertMatches('...Activation Code:...',
                            self.browser.contents)
@@ -996,5 +996,5 @@
         self.assertTrue(bed.owner == self.student_id)
         # BedTicketAddPage is now blocked.
-        self.browser.getLink("Book accommodation").click()
+        self.browser.getControl("Book accommodation").click()
         self.assertMatches('...You already booked a bed space...',
             self.browser.contents)
Index: /main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py	(revision 13459)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py	(revision 13460)
@@ -388,13 +388,4 @@
         return None
 
-    def selectBed(self, available_beds):
-        """Select a bed from a list of available beds.
-        Beds are sorted by the sort id of the hostel and the bed number.
-        The first bed found in this sorted list is taken.
-        """
-        sorted_beds = sorted(available_beds,
-            key=lambda bed: 1000 * bed.__parent__.sort_id + bed.bed_number)
-        return sorted_beds[0]
-
     # Uniben prefix
     STUDENT_ID_PREFIX = u'B'
