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.

Location:
main/waeup.uniben/trunk/src/waeup/uniben/students
Files:
3 edited

Legend:

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

    r8247 r8265  
    214214
    215215
    216 class ICustomPGStudentClearance(IUGStudentClearance):
     216class ICustomPGStudentClearance(ICustomUGStudentClearance):
    217217    """Representation of pg student clearance data.
    218218
  • 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
  • main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py

    r8263 r8265  
    149149
    150150    SEPARATORS_DICT = {
    151         'form.fst_sit_fname': _(u'First Sitting Recod'),
     151        'form.fst_sit_fname': _(u'First Sitting Record'),
    152152        'form.scd_sit_fname': _(u'Second Sitting Record'),
    153153        'form.alr_fname': _(u'Advanced Level Record'),
Note: See TracChangeset for help on using the changeset viewer.