1 | from waeup.custom.testing import FunctionalLayer |
---|
2 | from waeup.sirp.students.tests.test_browser import StudentsFullSetup |
---|
3 | from waeup.custom.configuration import SessionConfiguration |
---|
4 | |
---|
5 | class StudentUITests(StudentsFullSetup): |
---|
6 | # Tests for customized student class views and pages |
---|
7 | |
---|
8 | layer = FunctionalLayer |
---|
9 | |
---|
10 | def test_manage_payments(self): |
---|
11 | # Add missing configuration data |
---|
12 | self.app['configuration']['2004'].gown_fee = 150 |
---|
13 | self.app['configuration']['2004'].transfer_fee = 90 |
---|
14 | self.app['configuration']['2004'].clearance_fee = 120 |
---|
15 | self.app['configuration']['2004'].maint_fee = 180 |
---|
16 | |
---|
17 | # Managers can add online payment tickets |
---|
18 | self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') |
---|
19 | self.browser.open(self.payments_student_path) |
---|
20 | self.browser.getControl("Add online payment ticket").click() |
---|
21 | self.browser.getControl("Create ticket").click() |
---|
22 | self.assertMatches('...Amount could not be determined...', |
---|
23 | self.browser.contents) |
---|
24 | self.browser.open(self.manage_student_path) |
---|
25 | self.browser.getControl(name="transition").value = ['admit'] |
---|
26 | self.browser.getControl("Save").click() |
---|
27 | self.browser.getControl(name="transition").value = ['start_clearance'] |
---|
28 | self.browser.getControl("Save").click() |
---|
29 | self.browser.getControl(name="transition").value = ['request_clearance'] |
---|
30 | self.browser.getControl("Save").click() |
---|
31 | self.browser.getControl(name="transition").value = ['clear'] |
---|
32 | self.browser.getControl("Save").click() |
---|
33 | self.browser.open(self.payments_student_path + '/addop') |
---|
34 | self.browser.getControl("Create ticket").click() |
---|
35 | self.assertMatches('...ticket created...', |
---|
36 | self.browser.contents) |
---|
37 | self.browser.open(self.manage_student_path) |
---|
38 | self.browser.getControl( |
---|
39 | name="transition").value = ['pay_first_school_fee'] |
---|
40 | self.browser.getControl("Save").click() |
---|
41 | self.browser.getControl(name="transition").value = ['reset6'] |
---|
42 | self.browser.getControl("Save").click() |
---|
43 | self.browser.open(self.payments_student_path + '/addop') |
---|
44 | self.browser.getControl("Create ticket").click() |
---|
45 | self.assertMatches('...ticket created...', |
---|
46 | self.browser.contents) |
---|
47 | self.browser.open(self.payments_student_path + '/addop') |
---|
48 | self.browser.getControl(name="form.p_category").value = ['gown'] |
---|
49 | self.browser.getControl("Create ticket").click() |
---|
50 | self.browser.open(self.payments_student_path + '/addop') |
---|
51 | self.browser.getControl(name="form.p_category").value = ['transfer'] |
---|
52 | self.browser.getControl("Create ticket").click() |
---|
53 | self.browser.open(self.payments_student_path + '/addop') |
---|
54 | self.browser.getControl( |
---|
55 | name="form.p_category").value = ['bed_allocation'] |
---|
56 | self.browser.getControl("Create ticket").click() |
---|
57 | self.browser.open(self.payments_student_path + '/addop') |
---|
58 | self.browser.getControl( |
---|
59 | name="form.p_category").value = ['hostel_maintenance'] |
---|
60 | self.browser.getControl("Create ticket").click() |
---|
61 | self.browser.open(self.payments_student_path + '/addop') |
---|
62 | self.browser.getControl(name="form.p_category").value = ['clearance'] |
---|
63 | self.browser.getControl("Create ticket").click() |
---|
64 | self.certificate.study_mode = 'ug_pt' |
---|
65 | self.browser.open(self.payments_student_path + '/addop') |
---|
66 | self.browser.getControl(name="form.p_category").value = ['schoolfee'] |
---|
67 | self.browser.getControl("Create ticket").click() |
---|
68 | self.assertMatches('...Amount could not be determined...', |
---|
69 | self.browser.contents) |
---|
70 | |
---|
71 | # If the session configuration doesn't exist and error message will |
---|
72 | # be shown |
---|
73 | del self.app['configuration']['2004'] |
---|
74 | self.browser.open(self.payments_student_path) |
---|
75 | self.browser.getControl("Add online payment ticket").click() |
---|
76 | self.browser.getControl("Create ticket").click() |
---|
77 | self.assertMatches('...Session configuration object is not...', |
---|
78 | self.browser.contents) |
---|
79 | |
---|
80 | |
---|