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

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

Test coverage now 100%

  • Property svn:keywords set to Id
File size: 3.6 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.getLink("Manage").click()
16        self.browser.getControl("Add online payment ticket").click()
17        self.browser.getControl("Create ticket").click()
18        self.assertMatches('...Session configuration object is not available...',
19                           self.browser.contents)
20
21        # Set up SessionConfiguration object
22        configuration = SessionConfiguration()
23        configuration.academic_session = 2004
24        configuration.fee_1 = 20000
25        self.app['configuration'].addSessionConfiguration(configuration)
26
27        self.browser.open(self.payments_student_path)
28        self.browser.getLink("Manage").click()
29        self.browser.getControl("Add online payment ticket").click()
30        self.browser.getControl("Create ticket").click()
31        self.assertMatches('...Amount could not be determined...',
32                           self.browser.contents)
33        self.browser.open(self.manage_student_path)
34        self.browser.getControl(name="transition").value = ['admit']
35        self.browser.getControl("Save").click()
36        self.browser.getControl(name="transition").value = ['start_clearance']
37        self.browser.getControl("Save").click()
38        self.browser.getControl(name="transition").value = ['request_clearance']
39        self.browser.getControl("Save").click()
40        self.browser.getControl(name="transition").value = ['clear']
41        self.browser.getControl("Save").click()
42        self.browser.open(self.payments_student_path + '/addop')
43        self.browser.getControl("Create ticket").click()
44        self.assertMatches('...ticket created...',
45                           self.browser.contents)
46        self.browser.open(self.manage_student_path)
47        self.browser.getControl(name="transition").value = ['pay_first_school_fee']
48        self.browser.getControl("Save").click()
49        self.browser.getControl(name="transition").value = ['reset6']
50        self.browser.getControl("Save").click()
51        self.browser.open(self.payments_student_path + '/addop')
52        self.browser.getControl("Create ticket").click()
53        self.assertMatches('...ticket created...',
54                           self.browser.contents)
55        self.browser.open(self.payments_student_path + '/addop')
56        self.browser.getControl(name="form.p_category").value = ['gown']
57        self.browser.getControl("Create ticket").click()
58        self.browser.open(self.payments_student_path + '/addop')
59        self.browser.getControl(name="form.p_category").value = ['transfer']
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 = ['hostel_maintenance']
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
Note: See TracBrowser for help on using the repository browser.