Index: /main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py	(revision 8629)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py	(revision 8630)
@@ -186,2 +186,13 @@
             mapping = {'a':tcode}))
         return note
+
+class CustomApplicantRegistrationPage(ApplicantRegistrationPage):
+    """Captcha'd registration page for applicants.
+    """
+
+    def _redirect(self, email, password, applicant_id):
+        # Forward only email and credentials to landing page.
+        self.redirect(self.url(self.context, 'registration_complete',
+            data = dict(email=email, password=password,
+            applicant_id=applicant_id)))
+        return
Index: /main/waeup.uniben/trunk/src/waeup/uniben/applicants/tests.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/applicants/tests.py	(revision 8629)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/applicants/tests.py	(revision 8630)
@@ -20,4 +20,7 @@
 import tempfile
 import datetime
+import grok
+import pytz
+from zope.event import notify
 from zope.intid.interfaces import IIntIds
 from zope.interface.verify import verifyClass, verifyObject
@@ -79,4 +82,9 @@
         self.app['applicants']['app2011'] = self.ugcontainer
 
+        self.ugcontainer.mode = 'update'
+        delta = datetime.timedelta(days=10)
+        self.ugcontainer.startdate = datetime.datetime.now(pytz.utc) - delta
+        self.ugcontainer.enddate = datetime.datetime.now(pytz.utc) + delta
+
         # Populate university
         self.certificate = createObject('waeup.Certificate')
@@ -216,4 +224,32 @@
         self.assertEqual(payment.p_category,'application')
         self.assertEqual(payment.amount_auth, 300.0)
+        return
+
+    def test_register_applicant_update(self):
+        # An applicant can register himself.
+        self.ugapplicant.reg_number = u'1234'
+        notify(grok.ObjectModifiedEvent(self.ugapplicant))
+        self.browser.open('http://localhost/app/applicants/app2011/')
+        self.browser.getLink("Register for application").click()
+        # Fill the edit form with suitable values
+        self.browser.getControl(name="form.firstname").value = 'Klaus'
+        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
+        self.browser.getControl(name="form.reg_number").value = '1234'
+        self.browser.getControl("Get login credentials").click()
+        self.assertMatches('...Your registration was successful...',
+            self.browser.contents)
+        self.assertMatches('...<td>Password:</td>...',
+            self.browser.contents)
+        # The new applicant can be found in the catalog via the email address
+        cat = getUtility(ICatalog, name='applicants_catalog')
+        results = list(
+            cat.searchResults(email=('xx@yy.zz', 'xx@yy.zz')))
+        applicant = results[0]
+        self.assertEqual(applicant.lastname,'Under')
+        # The applicant can be found in the catalog via the reg_number
+        results = list(
+            cat.searchResults(
+            reg_number=(applicant.reg_number, applicant.reg_number)))
+        self.assertEqual(applicant,results[0])
         return
 
Index: /main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py	(revision 8629)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py	(revision 8630)
@@ -103,5 +103,5 @@
     if payment.r_code != '00':
         msg = _('Unsuccessful callback: ${a}', mapping = {'a': sr})
-        log = 'usuccessful callback for payment %s: %s' % (payment.p_id, sr)
+        log = 'unsuccessful callback for payment %s: %s' % (payment.p_id, sr)
         payment.p_state = 'failed'
         return False, msg, log
