Changeset 8039 for main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Timestamp:
- 4 Apr 2012, 11:25:41 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py
r7819 r8039 163 163 applicant_id = index.Field(attribute='applicant_id') 164 164 reg_number = index.Field(attribute='reg_number') 165 email = index.Field(attribute='email') 165 166 166 167 class ApplicantFactory(grok.GlobalUtility): -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r8037 r8039 745 745 form_fields = grok.AutoFields(IApplicantEdit).omit( 746 746 'locked', 'course_admitted', 'student_id', 747 'screening_score', 'reg_number'747 'screening_score', 748 748 ) 749 749 form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year') 750 750 form_fields['phone'].custom_widget = PhoneWidget 751 751 form_fields['applicant_id'].for_display = True 752 form_fields['reg_number'].for_display = True 752 753 grok.template('applicanteditpage') 753 754 manage_applications = False … … 917 918 if applicant.password is not None: 918 919 self.flash(_('Your password has already been set. ' 919 ' You canproceed to the login page.'))920 'Please proceed to the login page.')) 920 921 return 921 922 elif getattr(applicant,'firstname',None) is None: -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r8037 r8039 21 21 import shutil 22 22 import tempfile 23 import grok 23 24 from StringIO import StringIO 24 25 from datetime import datetime, date, timedelta 25 26 from mechanize import LinkNotFoundError 27 from zope.event import notify 26 28 from zope.component import createObject, getUtility 27 29 from zope.component.hooks import setSite, clearSite … … 866 868 self.container_path + '/registration_complete?email=xx%40yy.zz') 867 869 return 870 871 def test_change_password_request(self): 872 self.browser.open('http://localhost/app/sendpw') 873 self.browser.getControl(name="form.reg_number").value = '1234' 874 self.browser.getControl(name="form.email").value = 'aa@aa.ng' 875 self.browser.getControl("Get new login credentials").click() 876 self.assertTrue('No record found' in self.browser.contents) 877 self.applicant.email = 'aa@aa.ng' 878 # Update the catalog 879 notify(grok.ObjectModifiedEvent(self.applicant)) 880 self.browser.open('http://localhost/app/sendpw') 881 self.browser.getControl(name="form.reg_number").value = '1234' 882 self.browser.getControl(name="form.email").value = 'aa@aa.ng' 883 self.browser.getControl("Get new login credentials").click() 884 self.assertTrue( 885 'An email with your user name and password has been sent' 886 in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.