Ignore:
Timestamp:
16 Sep 2012, 04:30:12 (12 years ago)
Author:
Henrik Bettermann
Message:

Students book accommodation without AC. Bed is randomly selected.

Location:
main/waeup.fceokene/trunk/src/waeup/fceokene/students
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/browser.py

    r9181 r9190  
    2222from waeup.kofa.interfaces import MessageFactory as _
    2323from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
    24 from waeup.kofa.students.browser import StartClearancePage
     24from waeup.kofa.students.browser import StartClearancePage, BedTicketAddPage
    2525from kofacustom.nigeria.students.browser import (
    2626    NigeriaOnlinePaymentDisplayFormPage,
    2727    NigeriaOnlinePaymentAddFormPage,
    2828    NigeriaExportPDFPaymentSlipPage,
    29     NigeriaStudentClearanceEditFormPage)
     29    NigeriaStudentClearanceEditFormPage,
     30    )
    3031
    3132from waeup.fceokene.students.interfaces import ICustomStudentOnlinePayment
     
    8586    def dataNotComplete(self):
    8687        return False
     88
     89class BedTicketAddPage(BedTicketAddPage):
     90    """ Page to add an online payment ticket
     91    """
     92    grok.template('bookbed')
     93    buttonname = _('Create bed ticket')
     94    notice = ''
     95    with_ac = False
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_browser.py

    r9156 r9190  
    269269        self.assertMatches('...Clearance process has been started...',
    270270                           self.browser.contents)
     271
     272    def test_student_accommodation(self):
     273        # Login
     274        self.browser.open(self.login_path)
     275        self.browser.getControl(name="form.login").value = self.student_id
     276        self.browser.getControl(name="form.password").value = 'spwd'
     277        self.browser.getControl("Login").click()
     278
     279        # Students can book accommodation without AC ...
     280        self.browser.open(self.acco_path)
     281        IWorkflowInfo(self.student).fireTransition('admit')
     282        self.browser.getLink("Book accommodation").click()
     283        self.assertFalse('Activation Code:' in self.browser.contents)
     284        self.browser.getControl("Create bed ticket").click()
     285        # Bed is randomly selected but, since there is only
     286        # one bed for this student, we know that
     287        self.assertMatches('...Hall 1, Block A, Room 101, Bed A...',
     288                           self.browser.contents)
     289        return
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py

    r9153 r9190  
    1717##
    1818import grok
     19import random
    1920from time import time
    2021from zope.component import createObject
     
    2930
    3031    """
     32
     33    def selectBed(self, available_beds):
     34        """Randomly select a bed from a list of available beds.
     35
     36        """
     37        return random.choice(available_beds)
    3138
    3239    def getReturningData(self, student):
Note: See TracChangeset for help on using the changeset viewer.