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

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

Adjust customisation and base package.

  • Property svn:keywords set to Id
File size: 4.1 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        # 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
Note: See TracBrowser for help on using the repository browser.