source: main/waeup.custom/trunk/src/waeup/custom/students/tests.py @ 6972

Last change on this file since 6972 was 6950, checked in by Henrik Bettermann, 13 years ago

Add clearance fee and to session configuration.

  • Property svn:keywords set to Id
File size: 3.7 KB
Line 
1from waeup.custom.testing import FunctionalLayer
2from waeup.sirp.students.tests.test_browser import StudentsFullSetup
3from waeup.custom.configuration import SessionConfiguration
4
5class StudentUITests(StudentsFullSetup):
6    # Tests for customized student class views and pages
7
8    layer = FunctionalLayer
9
10    def test_manage_payments(self):
11
12        # Managers can add online payment tickets
13        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
14        self.browser.open(self.payments_student_path)
15        self.browser.getControl("Add online payment ticket").click()
16        self.browser.getControl("Create ticket").click()
17        self.assertMatches('...Session configuration object is not available...',
18                           self.browser.contents)
19
20        # Set up SessionConfiguration object
21        configuration = SessionConfiguration()
22        configuration.academic_session = 2004
23        configuration.fee_1 = 20000
24        self.app['configuration'].addSessionConfiguration(configuration)
25
26        self.browser.open(self.payments_student_path)
27        self.browser.getControl("Add online payment ticket").click()
28        self.browser.getControl("Create ticket").click()
29        self.assertMatches('...Amount could not be determined...',
30                           self.browser.contents)
31        self.browser.open(self.manage_student_path)
32        self.browser.getControl(name="transition").value = ['admit']
33        self.browser.getControl("Save").click()
34        self.browser.getControl(name="transition").value = ['start_clearance']
35        self.browser.getControl("Save").click()
36        self.browser.getControl(name="transition").value = ['request_clearance']
37        self.browser.getControl("Save").click()
38        self.browser.getControl(name="transition").value = ['clear']
39        self.browser.getControl("Save").click()
40        self.browser.open(self.payments_student_path + '/addop')
41        self.browser.getControl("Create ticket").click()
42        self.assertMatches('...ticket created...',
43                           self.browser.contents)
44        self.browser.open(self.manage_student_path)
45        self.browser.getControl(name="transition").value = ['pay_first_school_fee']
46        self.browser.getControl("Save").click()
47        self.browser.getControl(name="transition").value = ['reset6']
48        self.browser.getControl("Save").click()
49        self.browser.open(self.payments_student_path + '/addop')
50        self.browser.getControl("Create ticket").click()
51        self.assertMatches('...ticket created...',
52                           self.browser.contents)
53        self.browser.open(self.payments_student_path + '/addop')
54        self.browser.getControl(name="form.p_category").value = ['gown']
55        self.browser.getControl("Create ticket").click()
56        self.browser.open(self.payments_student_path + '/addop')
57        self.browser.getControl(name="form.p_category").value = ['transfer']
58        self.browser.getControl("Create ticket").click()
59        self.browser.open(self.payments_student_path + '/addop')
60        self.browser.getControl(name="form.p_category").value = ['hostel_maintenance']
61        self.browser.getControl("Create ticket").click()
62        self.browser.open(self.payments_student_path + '/addop')
63        self.browser.getControl(name="form.p_category").value = ['clearance']
64        self.browser.getControl("Create ticket").click()
65        self.certificate.study_mode = 'ug_pt'
66        self.browser.open(self.payments_student_path + '/addop')
67        self.browser.getControl(name="form.p_category").value = ['schoolfee']
68        self.browser.getControl("Create ticket").click()
69        self.assertMatches('...Amount could not be determined...',
70                           self.browser.contents)
71
72
Note: See TracBrowser for help on using the repository browser.