1 | # -*- coding: utf-8 -*- |
---|
2 | from waeup.kofa.testing import FunctionalTestCase |
---|
3 | from zope.component import getUtility |
---|
4 | from waeup.kofa.students.interfaces import IStudentsUtils |
---|
5 | from waeup.kofa.students.tests.test_browser import StudentsFullSetup |
---|
6 | from waeup.kwarapoly.testing import FunctionalLayer |
---|
7 | |
---|
8 | class 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 |
---|