Ignore:
Timestamp:
6 Oct 2015, 07:37:06 (9 years ago)
Author:
Henrik Bettermann
Message:

Further customize checkAccommodationRequirements.

Add student union dues to bed allocation fees.

File:
1 edited

Legend:

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

    r13252 r13283  
    907907
    908908    def test_student_accommodation(self):
     909        bed = Bed()
     910        bed.bed_id = u'hall-1_A_101_C'
     911        bed.bed_number = 3
     912        bed.owner = NOT_OCCUPIED
     913        bed.bed_type = u'regular_male_fi'
     914        self.app['hostels']['hall-1'].addBed(bed)
    909915        self.browser.open(self.login_path)
    910916        self.browser.getControl(name="form.login").value = self.student_id
     
    941947        self.assertMatches('...Your data are incomplete...',
    942948            self.browser.contents)
    943         self.student['studycourse'].current_level = 100
     949        self.student['studycourse'].current_level = 200
     950        # ... or student is not the an allowed state ...
     951        self.browser.getLink("Book accommodation").click()
     952        self.assertMatches('...You are in the wrong...',
     953                           self.browser.contents)
     954        self.app['hostels'].accommodation_states = ['admitted', 'school fee paid']
     955        IWorkflowState(self.student).setState('school fee paid')
    944956        # ... or student has not appropriate verdict (Uniben only!)
     957        self.student['studycourse'].entry_session = 2000 # non-fresh
     958        self.student['studycourse'].current_level = 500 # final-year
    945959        self.student['studycourse'].current_verdict = 'C'
    946960        self.browser.getLink("Book accommodation").click()
     
    948962            self.browser.contents)
    949963        self.student['studycourse'].current_verdict = 'A'
    950         # ... or student is not the an allowed state ...
    951         self.browser.getLink("Book accommodation").click()
    952         self.assertMatches('...You are in the wrong...',
    953                            self.browser.contents)
    954         IWorkflowInfo(self.student).fireTransition('admit')
    955964        self.browser.getLink("Book accommodation").click()
    956965        self.assertMatches('...Activation Code:...',
     
    970979                           self.browser.contents)
    971980        # The bed remains empty.
    972         bed = self.app['hostels']['hall-1']['hall-1_A_101_A']
     981        bed = self.app['hostels']['hall-1']['hall-1_A_101_C']
    973982        self.assertTrue(bed.owner == NOT_OCCUPIED)
    974983        ac.owner = self.student_id
     
    976985        self.browser.getControl(name="ac_number").value = sfenumber
    977986        self.browser.getControl("Create bed ticket").click()
    978         self.assertMatches('...Hall 1, Block A, Room 101, Bed A...',
     987        self.assertMatches('...Hall 1, Block A, Room 101, Bed C...',
    979988                           self.browser.contents)
    980989        # Bed has been allocated.
     
    986995        # The bed ticket displays the data correctly.
    987996        self.browser.open(self.acco_path + '/2004')
    988         self.assertMatches('...Hall 1, Block A, Room 101, Bed A...',
     997        self.assertMatches('...Hall 1, Block A, Room 101, Bed C...',
    989998                           self.browser.contents)
    990999        self.assertMatches('...2004/2005...', self.browser.contents)
    991         self.assertMatches('...regular_male_fr...', self.browser.contents)
     1000        self.assertMatches('...regular_male_fi...', self.browser.contents)
    9921001        self.assertMatches('...%s...' % pin, self.browser.contents)
    9931002        # Students can open the pdf slip.
Note: See TracChangeset for help on using the changeset viewer.