Ignore:
Timestamp:
5 Jun 2012, 15:07:26 (12 years ago)
Author:
Henrik Bettermann
Message:

Customize CustomApplicantRegistrationPage?.

Uniben applicants do see the login credentials on registration landing page.

File:
1 edited

Legend:

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

    r8622 r8630  
    2020import tempfile
    2121import datetime
     22import grok
     23import pytz
     24from zope.event import notify
    2225from zope.intid.interfaces import IIntIds
    2326from zope.interface.verify import verifyClass, verifyObject
     
    7982        self.app['applicants']['app2011'] = self.ugcontainer
    8083
     84        self.ugcontainer.mode = 'update'
     85        delta = datetime.timedelta(days=10)
     86        self.ugcontainer.startdate = datetime.datetime.now(pytz.utc) - delta
     87        self.ugcontainer.enddate = datetime.datetime.now(pytz.utc) + delta
     88
    8189        # Populate university
    8290        self.certificate = createObject('waeup.Certificate')
     
    216224        self.assertEqual(payment.p_category,'application')
    217225        self.assertEqual(payment.amount_auth, 300.0)
     226        return
     227
     228    def test_register_applicant_update(self):
     229        # An applicant can register himself.
     230        self.ugapplicant.reg_number = u'1234'
     231        notify(grok.ObjectModifiedEvent(self.ugapplicant))
     232        self.browser.open('http://localhost/app/applicants/app2011/')
     233        self.browser.getLink("Register for application").click()
     234        # Fill the edit form with suitable values
     235        self.browser.getControl(name="form.firstname").value = 'Klaus'
     236        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
     237        self.browser.getControl(name="form.reg_number").value = '1234'
     238        self.browser.getControl("Get login credentials").click()
     239        self.assertMatches('...Your registration was successful...',
     240            self.browser.contents)
     241        self.assertMatches('...<td>Password:</td>...',
     242            self.browser.contents)
     243        # The new applicant can be found in the catalog via the email address
     244        cat = getUtility(ICatalog, name='applicants_catalog')
     245        results = list(
     246            cat.searchResults(email=('xx@yy.zz', 'xx@yy.zz')))
     247        applicant = results[0]
     248        self.assertEqual(applicant.lastname,'Under')
     249        # The applicant can be found in the catalog via the reg_number
     250        results = list(
     251            cat.searchResults(
     252            reg_number=(applicant.reg_number, applicant.reg_number)))
     253        self.assertEqual(applicant,results[0])
    218254        return
    219255
Note: See TracChangeset for help on using the changeset viewer.