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.fceokene.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 | self.student['studycourse'].current_level = 200 |
---|
17 | acc_details = students_utils.getAccommodationDetails(self.student) |
---|
18 | self.assertEqual(acc_details['bt'], 'regular_male_re') |
---|
19 | self.student['studycourse'].current_level = 300 |
---|
20 | acc_details = students_utils.getAccommodationDetails(self.student) |
---|
21 | self.assertEqual(acc_details['bt'], 'regular_male_fi') |
---|
22 | self.student['studycourse'].current_level = 400 |
---|
23 | acc_details = students_utils.getAccommodationDetails(self.student) |
---|
24 | self.assertEqual(acc_details['bt'], 'regular_male_fi') |
---|
25 | self.student['studycourse'].current_level = 500 |
---|
26 | acc_details = students_utils.getAccommodationDetails(self.student) |
---|
27 | self.assertEqual(acc_details['bt'], 'regular_male_fi') |
---|
28 | return |
---|