Changeset 8630
- Timestamp:
- 5 Jun 2012, 15:07:26 (12 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py
r8569 r8630 186 186 mapping = {'a':tcode})) 187 187 return note 188 189 class CustomApplicantRegistrationPage(ApplicantRegistrationPage): 190 """Captcha'd registration page for applicants. 191 """ 192 193 def _redirect(self, email, password, applicant_id): 194 # Forward only email and credentials to landing page. 195 self.redirect(self.url(self.context, 'registration_complete', 196 data = dict(email=email, password=password, 197 applicant_id=applicant_id))) 198 return -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/tests.py
r8622 r8630 20 20 import tempfile 21 21 import datetime 22 import grok 23 import pytz 24 from zope.event import notify 22 25 from zope.intid.interfaces import IIntIds 23 26 from zope.interface.verify import verifyClass, verifyObject … … 79 82 self.app['applicants']['app2011'] = self.ugcontainer 80 83 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 81 89 # Populate university 82 90 self.certificate = createObject('waeup.Certificate') … … 216 224 self.assertEqual(payment.p_category,'application') 217 225 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]) 218 254 return 219 255 -
main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py
r8568 r8630 103 103 if payment.r_code != '00': 104 104 msg = _('Unsuccessful callback: ${a}', mapping = {'a': sr}) 105 log = 'u successful callback for payment %s: %s' % (payment.p_id, sr)105 log = 'unsuccessful callback for payment %s: %s' % (payment.p_id, sr) 106 106 payment.p_state = 'failed' 107 107 return False, msg, log
Note: See TracChangeset for help on using the changeset viewer.