Ignore:
Timestamp:
29 Aug 2011, 08:07:36 (13 years ago)
Author:
Henrik Bettermann
Message:

Add manage page for study course objects.

Further increase test coverage.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r6647 r6649  
    232232        student.student_id = student_id
    233233        self.applyData(student, **data)
    234         #import pdb; pdb.set_trace()
    235234        try:
    236235            self.context.addStudent(student)
     
    337336    grok.context(IStudent)
    338337    grok.name('edit_clearance')
    339     grok.require('waeup.viewStudents')
     338    grok.require('waeup.manageStudents')
    340339    form_fields = grok.AutoFields(IStudentClearance)
    341340    label = 'Edit clearance data'
     
    391390        return '%s: Study Course' % self.context.__parent__.name
    392391
     392class StudyCourseManageActionButton(ManageActionButton):
     393    grok.order(1)
     394    grok.context(IStudentStudyCourse)
     395    grok.view(StudyCourseDisplayFormPage)
     396    grok.require('waeup.manageStudents')
     397    text = 'Edit'
     398    target = 'edit'
     399
     400class StudyCourseManageFormPage(WAeUPEditFormPage):
     401    """ Page to edit the student study course data
     402    """
     403    grok.context(IStudentStudyCourse)
     404    grok.name('edit')
     405    grok.require('waeup.manageStudents')
     406    form_fields = grok.AutoFields(IStudentStudyCourse)
     407    label = 'Edit clearance data'
     408    title = 'Study Course'
     409    label = 'Edit study course'
     410    pnav = 4
     411
    393412class PaymentsDisplayFormPage(WAeUPDisplayFormPage):
    394413    """ Page to display the student payments
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py

    r6647 r6649  
    150150        self.browser.getControl("Create student record").click()
    151151        self.assertTrue('Student record created' in self.browser.contents)
     152        self.browser.open(self.manage_container_path)
     153        self.browser.getLink("Add student").click()
     154        self.browser.getControl(name="form.student_id").value = 'A123456'
     155        self.browser.getControl(name="form.name").value = 'Bob Brother'
     156        self.browser.getControl("Create student record").click()
     157        self.assertTrue('The student id chosen already exists' in self.browser.contents)
    152158
    153159        self.browser.open(self.container_path)
     
    200206        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    201207        self.assertEqual(self.browser.url, self.manage_student_path)
    202         # Managers can fire transitions
     208        # Managers can edit base data and fire transitions
    203209        self.browser.getControl(name="transition").value = ['admit']
     210        self.browser.getControl(name="form.name").value = 'John Tester'
    204211        self.browser.getControl("Save").click()
    205212        self.assertTrue('Form has been saved' in self.browser.contents)
     
    225232        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    226233        self.assertEqual(self.browser.url, self.studycourse_student_path)
     234        self.browser.getLink("Edit").click()
     235        self.assertTrue('Edit study course' in self.browser.contents)
    227236
    228237        self.browser.open(self.student_path)
Note: See TracChangeset for help on using the changeset viewer.