Ignore:
Timestamp:
3 Dec 2011, 08:35:33 (13 years ago)
Author:
Henrik Bettermann
Message:

Use reduced display form page as header in payment receipts.
Add more tests.

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

Legend:

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

    r7255 r7259  
    477477        return ''
    478478
     479class ApplicantBaseDisplayFormPage(ApplicantDisplayFormPage):
     480    grok.context(IApplicant)
     481    grok.name('base')
     482    form_fields = grok.AutoFields(IApplicant).select(
     483        'applicant_id', 'firstname', 'lastname','email', 'course1')
     484
    479485class AcceptanceFeePaymentAddPage(grok.View):
    480486    """ Page to add an online payment ticket
     
    625631            self.redirect(self.url(self.context))
    626632            return
    627         applicantview = ApplicantDisplayFormPage(self.context.__parent__,
     633        applicantview = ApplicantBaseDisplayFormPage(self.context.__parent__,
    628634            self.request)
    629635        students_utils = getUtility(IStudentsUtils)
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py

    r7252 r7259  
    286286        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    287287        self.assertEqual(self.browser.url, self.add_applicant_path)
    288         self.browser.getControl(name="form.firstname").value = 'Albert'
    289         self.browser.getControl(name="form.lastname").value = 'Einstein'
     288        self.browser.getControl(name="form.firstname").value = 'Alois'
     289        self.browser.getControl(name="form.middlenames").value = 'Kofi'
     290        self.browser.getControl(name="form.lastname").value = 'Bettermann'
    290291        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
    291292        self.browser.getControl("Create application record").click()
     
    313314        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    314315        self.fill_correct_values()
     316        # Fire transition
    315317        self.browser.getControl(name="transition").value = ['start']
    316318        self.browser.getControl("Save").click()
     
    319321        self.browser.open(self.view_path)
    320322        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    321         self.browser.open(self.slip_path)
    322         self.assertEqual(self.browser.headers['Status'], '200 Ok')
    323         self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
     323        # Change course_admitted
    324324        self.browser.open(self.manage_path)
    325325        self.browser.getControl(name="form.course_admitted").value = []
    326326        self.browser.getControl("Save").click()
     327        self.assertMatches('...Form has been saved...', self.browser.contents)
     328        # Change password
     329        self.browser.getControl(name="password").value = 'secret'
     330        self.browser.getControl(name="control_password").value = 'secre'
     331        self.browser.getControl("Save").click()
     332        self.assertMatches('...Passwords do not match...', self.browser.contents)
     333        self.browser.getControl(name="password").value = 'secret'
     334        self.browser.getControl(name="control_password").value = 'secret'
     335        self.browser.getControl("Save").click()
     336        self.assertMatches('...Form has been saved...', self.browser.contents)
     337        # Open pdf slip
    327338        self.browser.open(self.slip_path)
    328339        self.assertEqual(self.browser.headers['Status'], '200 Ok')
Note: See TracChangeset for help on using the changeset viewer.