Changeset 7792 for main


Ignore:
Timestamp:
8 Mar 2012, 03:24:11 (13 years ago)
Author:
uli
Message:

Add basic test for new school grades.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/branches/ulif-schoolgrades/src/waeup/sirp/applicants/tests/test_browser.py

    r7685 r7792  
    752752        self.browser.open(self.edit_path)
    753753        self.assertTrue(
    754             '<option selected="selected" value="CERT1">' in self.browser.contents)
     754            '<option selected="selected" value="CERT1">'
     755            in self.browser.contents)
     756
     757    def test_school_grades(self):
     758        # we can add school grades
     759        self.login()
     760        self.browser.open(self.edit_path)
     761        self.fill_correct_values() # Fill other fields
     762        # add a new (empty) row with subject/grade
     763        self.browser.getControl(name="form.school_grades.add").click()
     764        # pick first subject (after <no value>)...
     765        ctrl_subj = self.browser.getControl(
     766            name="form.school_grades.0.subject")
     767        ctrl_subj.value = [ctrl_subj.options[1]]
     768        display_subj = ctrl_subj.displayOptions[1]
     769        # pick first grade (after <no value>)...
     770        ctrl_grade = self.browser.getControl(
     771            name="form.school_grades.0.grade")
     772        ctrl_grade.value = [ctrl_grade.options[1]]
     773        display_grade = ctrl_grade.displayOptions[1]
     774        # save everything
     775        self.browser.getControl("Save").click()
     776        self.assertTrue(
     777            '<input type="hidden" name="form.school_grades.count" value="1" />'
     778            in self.browser.contents)
     779        # we can also see the new subject/grade in display view
     780        self.browser.open(self.view_path)
     781        self.assertTrue(
     782            display_subj in self.browser.contents)
     783        self.assertTrue(
     784            display_grade in self.browser.contents)
     785        return
    755786
    756787class ApplicantRegisterTests(ApplicantsFullSetup):
Note: See TracChangeset for help on using the changeset viewer.