source: main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_utils.py @ 10009

Last change on this file since 10009 was 9614, checked in by Henrik Bettermann, 12 years ago

Set bed type correctly.

  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1# -*- coding: utf-8 -*-
2from waeup.kofa.testing import FunctionalTestCase
3from zope.component import getUtility
4from waeup.kofa.students.interfaces import IStudentsUtils
5from waeup.kofa.students.tests.test_browser import StudentsFullSetup
6from waeup.kwarapoly.testing import FunctionalLayer
7
8class BedAllocationTests(StudentsFullSetup):
9
10    layer = FunctionalLayer
11
12    def test_getAccommodationDetails(self):
13        students_utils = getUtility(IStudentsUtils)
14        acc_details  = students_utils.getAccommodationDetails(self.student)
15        self.assertEqual(acc_details['bt'], 'regular_male_fr')
16
17        self.student['studycourse'].current_level = 200
18        acc_details  = students_utils.getAccommodationDetails(self.student)
19        self.assertEqual(acc_details['bt'], 'regular_male_re')
20
21        self.student['studycourse'].current_level = 210
22        acc_details  = students_utils.getAccommodationDetails(self.student)
23        self.assertEqual(acc_details['bt'], 'regular_male_re')
24
25        self.student['studycourse'].current_level = 300
26        acc_details  = students_utils.getAccommodationDetails(self.student)
27        self.assertEqual(acc_details['bt'], 'regular_male_fi')
28
29        self.student['studycourse'].current_level = 400
30        acc_details  = students_utils.getAccommodationDetails(self.student)
31        self.assertEqual(acc_details['bt'], 'regular_male_fr')
32
33        self.student['studycourse'].current_level = 500
34        acc_details  = students_utils.getAccommodationDetails(self.student)
35        self.assertEqual(acc_details['bt'], 'regular_male_re')
36
37        self.student['studycourse'].current_level = 510
38        acc_details  = students_utils.getAccommodationDetails(self.student)
39        self.assertEqual(acc_details['bt'], 'regular_male_re')
40
41        self.student['studycourse'].current_level = 600
42        acc_details  = students_utils.getAccommodationDetails(self.student)
43        self.assertEqual(acc_details['bt'], 'regular_male_fi')
44        return
Note: See TracBrowser for help on using the repository browser.