Index: /main/waeup.futminna/trunk/src/waeup/futminna/students/browser.py
===================================================================
--- /main/waeup.futminna/trunk/src/waeup/futminna/students/browser.py	(revision 9402)
+++ /main/waeup.futminna/trunk/src/waeup/futminna/students/browser.py	(revision 9403)
@@ -19,8 +19,10 @@
 from zope.i18n import translate
 from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
+from waeup.kofa.students.browser import BedTicketAddPage
 from kofacustom.nigeria.students.browser import (
     NigeriaOnlinePaymentDisplayFormPage,
     NigeriaOnlinePaymentAddFormPage,
     NigeriaExportPDFPaymentSlipPage)
+from waeup.kofa.interfaces import MessageFactory as _
 
 from waeup.futminna.students.interfaces import ICustomStudentOnlinePayment
@@ -49,2 +51,10 @@
     form_fields['creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     form_fields['payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
+
+class CustomBedTicketAddPage(BedTicketAddPage):
+    """ Page to add an online payment ticket
+    """
+    grok.template('bookbed')
+    buttonname = _('Create bed ticket')
+    notice = ''
+    with_ac = False
Index: /main/waeup.futminna/trunk/src/waeup/futminna/students/browser_templates/bookbed.pt
===================================================================
--- /main/waeup.futminna/trunk/src/waeup/futminna/students/browser_templates/bookbed.pt	(revision 9403)
+++ /main/waeup.futminna/trunk/src/waeup/futminna/students/browser_templates/bookbed.pt	(revision 9403)
@@ -0,0 +1,11 @@
+<form method="POST" i18n:domain="waeup.fceokene">
+
+  <p i18n:translate="">
+    You data have been approved. You can book a bed by
+    clicking the button below.
+  </p>
+
+  <input type="submit" name="SUBMIT" class="btn primary"
+         tal:attributes="value view/buttonname" />
+
+</form>
Index: /main/waeup.futminna/trunk/src/waeup/futminna/students/tests/test_browser.py
===================================================================
--- /main/waeup.futminna/trunk/src/waeup/futminna/students/tests/test_browser.py	(revision 9402)
+++ /main/waeup.futminna/trunk/src/waeup/futminna/students/tests/test_browser.py	(revision 9403)
@@ -32,4 +32,5 @@
     IExtFileStore, IFileStoreNameChooser)
 from waeup.kofa.students.interfaces import IStudentsUtils
+from waeup.kofa.hostels.hostel import Bed, NOT_OCCUPIED
 from waeup.futminna.testing import FunctionalLayer
 
@@ -92,4 +93,11 @@
         self.student['studycourse'].current_verdict = 'A'
         self.student['studycourse'].current_level = 100
+        # Add sse bed
+        bed = Bed()
+        bed.bed_id = u'hall-1_A_101_C'
+        bed.bed_number = 2
+        bed.owner = NOT_OCCUPIED
+        bed.bed_type = u'sse_male_fr'
+        self.app['hostels']['hall-1'].addBed(bed)
 
     def test_get_returning_data(self):
@@ -162,2 +170,21 @@
         details = utils.getAccommodationDetails(self.student)
         self.assertEqual(details['bt'], u'sse_male_fr')
+
+    def test_student_accommodation(self):
+        # Login
+        self.browser.open(self.login_path)
+        self.browser.getControl(name="form.login").value = self.student_id
+        self.browser.getControl(name="form.password").value = 'spwd'
+        self.browser.getControl("Login").click()
+
+        # Students can book accommodation without AC ...
+        self.browser.open(self.acco_path)
+        IWorkflowState(self.student).setState('admitted')
+        self.browser.getLink("Book accommodation").click()
+        self.assertFalse('Activation Code:' in self.browser.contents)
+        self.browser.getControl("Create bed ticket").click()
+        # Bed is randomly selected but, since there is only
+        # one bed for this student, we know that
+        self.assertMatches('...Hall 1, Block A, Room 101, Bed C...',
+                           self.browser.contents)
+        return
Index: /main/waeup.futminna/trunk/src/waeup/futminna/students/utils.py
===================================================================
--- /main/waeup.futminna/trunk/src/waeup/futminna/students/utils.py	(revision 9402)
+++ /main/waeup.futminna/trunk/src/waeup/futminna/students/utils.py	(revision 9403)
@@ -17,4 +17,5 @@
 ##
 import grok
+import random
 from time import time
 from zope.component import createObject
@@ -28,4 +29,10 @@
 
     """
+
+    def selectBed(self, available_beds):
+        """Randomly select a bed from a list of available beds.
+
+        """
+        return random.choice(available_beds)
 
     def getReturningData(self, student):
