Ignore:
Timestamp:
24 Apr 2012, 20:02:14 (13 years ago)
Author:
Henrik Bettermann
Message:

Add tests for customized clearance forms and remove bugs found.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py

    r8204 r8265  
    9595    layer = FunctionalLayer
    9696
     97    def test_manage_access(self):
     98        # Managers can access the pages of students
     99        # and can perform actions
     100        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     101        # The student created in the base package is an ug student
     102        self.browser.open(self.student_path)
     103        self.browser.getLink("Clearance Data").click()
     104        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     105        self.assertEqual(self.browser.url, self.clearance_path)
     106        self.browser.getLink("Manage").click()
     107        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     108        self.assertEqual(self.browser.url, self.manage_clearance_path)
     109        self.browser.getControl(name="form.date_of_birth").value = '09/10/1961'
     110        self.browser.getControl("Save").click()
     111        self.assertMatches('...Form has been saved...',
     112                           self.browser.contents)
     113        self.assertMatches('...First Sitting Record...',
     114                           self.browser.contents)
     115        # There is no pg field in the clearance form
     116        self.assertFalse('Second Higher Education Record'
     117            in self.browser.contents)
     118        # Now we change the study mode ...
     119        self.certificate.study_mode = 'pg_ft'
     120        self.browser.open(self.clearance_path)
     121        # ... and additional pg clearance fields appear
     122        self.assertMatches('...Second Higher Education Record...',
     123                           self.browser.contents)
     124        # But also fields from the ug form are displayed
     125        self.assertMatches('...First Sitting Record...',
     126                           self.browser.contents)
     127
    97128    def test_manage_payments(self):
    98129        # Add missing configuration data
Note: See TracChangeset for help on using the changeset viewer.