Ignore:
Timestamp:
24 Oct 2012, 06:37:08 (12 years ago)
Author:
Henrik Bettermann
Message:

Students book accommodation without AC. Bed is randomly selected.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.futminna/trunk/src/waeup/futminna/students/tests/test_browser.py

    r9402 r9403  
    3232    IExtFileStore, IFileStoreNameChooser)
    3333from waeup.kofa.students.interfaces import IStudentsUtils
     34from waeup.kofa.hostels.hostel import Bed, NOT_OCCUPIED
    3435from waeup.futminna.testing import FunctionalLayer
    3536
     
    9293        self.student['studycourse'].current_verdict = 'A'
    9394        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)
    94102
    95103    def test_get_returning_data(self):
     
    162170        details = utils.getAccommodationDetails(self.student)
    163171        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
Note: See TracChangeset for help on using the changeset viewer.