Changeset 9403 for main/waeup.futminna/trunk/src/waeup
- Timestamp:
- 24 Oct 2012, 06:37:08 (12 years ago)
- Location:
- main/waeup.futminna/trunk/src/waeup/futminna/students
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.futminna/trunk/src/waeup/futminna/students/browser.py
r8912 r9403 19 19 from zope.i18n import translate 20 20 from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget 21 from waeup.kofa.students.browser import BedTicketAddPage 21 22 from kofacustom.nigeria.students.browser import ( 22 23 NigeriaOnlinePaymentDisplayFormPage, 23 24 NigeriaOnlinePaymentAddFormPage, 24 25 NigeriaExportPDFPaymentSlipPage) 26 from waeup.kofa.interfaces import MessageFactory as _ 25 27 26 28 from waeup.futminna.students.interfaces import ICustomStudentOnlinePayment … … 49 51 form_fields['creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 50 52 form_fields['payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 53 54 class CustomBedTicketAddPage(BedTicketAddPage): 55 """ Page to add an online payment ticket 56 """ 57 grok.template('bookbed') 58 buttonname = _('Create bed ticket') 59 notice = '' 60 with_ac = False -
main/waeup.futminna/trunk/src/waeup/futminna/students/tests/test_browser.py
r9402 r9403 32 32 IExtFileStore, IFileStoreNameChooser) 33 33 from waeup.kofa.students.interfaces import IStudentsUtils 34 from waeup.kofa.hostels.hostel import Bed, NOT_OCCUPIED 34 35 from waeup.futminna.testing import FunctionalLayer 35 36 … … 92 93 self.student['studycourse'].current_verdict = 'A' 93 94 self.student['studycourse'].current_level = 100 95 # Add sse bed 96 bed = Bed() 97 bed.bed_id = u'hall-1_A_101_C' 98 bed.bed_number = 2 99 bed.owner = NOT_OCCUPIED 100 bed.bed_type = u'sse_male_fr' 101 self.app['hostels']['hall-1'].addBed(bed) 94 102 95 103 def test_get_returning_data(self): … … 162 170 details = utils.getAccommodationDetails(self.student) 163 171 self.assertEqual(details['bt'], u'sse_male_fr') 172 173 def test_student_accommodation(self): 174 # Login 175 self.browser.open(self.login_path) 176 self.browser.getControl(name="form.login").value = self.student_id 177 self.browser.getControl(name="form.password").value = 'spwd' 178 self.browser.getControl("Login").click() 179 180 # Students can book accommodation without AC ... 181 self.browser.open(self.acco_path) 182 IWorkflowState(self.student).setState('admitted') 183 self.browser.getLink("Book accommodation").click() 184 self.assertFalse('Activation Code:' in self.browser.contents) 185 self.browser.getControl("Create bed ticket").click() 186 # Bed is randomly selected but, since there is only 187 # one bed for this student, we know that 188 self.assertMatches('...Hall 1, Block A, Room 101, Bed C...', 189 self.browser.contents) 190 return -
main/waeup.futminna/trunk/src/waeup/futminna/students/utils.py
r9402 r9403 17 17 ## 18 18 import grok 19 import random 19 20 from time import time 20 21 from zope.component import createObject … … 28 29 29 30 """ 31 32 def selectBed(self, available_beds): 33 """Randomly select a bed from a list of available beds. 34 35 """ 36 return random.choice(available_beds) 30 37 31 38 def getReturningData(self, student):
Note: See TracChangeset for help on using the changeset viewer.