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

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

The customized payment functions can now use the new SessionConfiguration? objects.

  • Property svn:keywords set to Id
File size: 2.3 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        # Set up SessionConfiguration object
13        configuration = SessionConfiguration()
14        configuration.academic_session = 2004
15        configuration.fee_1 = 20000
16        self.app['configuration'].addSessionConfiguration(configuration)
17
18        # Managers can add online payment tickets
19        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
20        self.browser.open(self.payments_student_path)
21        self.browser.getLink("Manage").click()
22        self.browser.getControl("Add online payment ticket").click()
23        self.browser.getControl("Create ticket").click()
24        self.assertMatches('...Amount could not be determined...',
25                           self.browser.contents)
26        self.browser.open(self.manage_student_path)
27        self.browser.getControl(name="transition").value = ['admit']
28        self.browser.getControl("Save").click()
29        self.browser.getControl(name="transition").value = ['start_clearance']
30        self.browser.getControl("Save").click()
31        self.browser.getControl(name="transition").value = ['request_clearance']
32        self.browser.getControl("Save").click()
33        self.browser.getControl(name="transition").value = ['clear']
34        self.browser.getControl("Save").click()
35        self.browser.open(self.payments_student_path + '/addop')
36        self.browser.getControl("Create ticket").click()
37        self.assertMatches('...ticket created...',
38                           self.browser.contents)
39        self.browser.open(self.manage_student_path)
40        self.browser.getControl(name="transition").value = ['pay_first_school_fee']
41        self.browser.getControl("Save").click()
42        self.browser.getControl(name="transition").value = ['reset6']
43        self.browser.getControl("Save").click()
44        self.browser.open(self.payments_student_path + '/addop')
45        self.browser.getControl("Create ticket").click()
46        self.assertMatches('...ticket created...',
47                           self.browser.contents)
Note: See TracBrowser for help on using the repository browser.