Changeset 14306 for main/waeup.aaue/trunk/src/waeup/aaue
- Timestamp:
- 3 Dec 2016, 08:29:30 (8 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/applicants/interfaces.py
r14304 r14306 551 551 552 552 dispatch_address = schema.Text( 553 title = _(u'Dispatch Address '),554 description = u'Address to which transcript should be posted.',553 title = _(u'Dispatch Addresses'), 554 description = u'Addresses to which transcript should be posted.', 555 555 required = False, 556 556 readonly = False, … … 607 607 ) 608 608 609 no_copies = schema.Choice( 610 title = _(u'Number of Copies'), 611 description = u'Must correspond with the number of dispatch addresses above.', 612 values=[1, 2, 3, 4], 613 required = False, 614 readonly = False, 615 default = 1, 616 ) 617 609 618 class ICertificateRequest(IKofaObject): 610 619 """A transcript applicant. … … 688 697 689 698 dispatch_address = schema.Text( 690 title = _(u'Dispatch Address '),691 description = u'Address to which certificate should be posted.',699 title = _(u'Dispatch Addresses'), 700 description = u'Addresses to which certificate should be posted.', 692 701 required = False, 693 702 readonly = False, … … 713 722 required = False, 714 723 readonly = False, 724 ) 725 726 no_copies = schema.Choice( 727 title = _(u'Number of Copies'), 728 description = u'Must correspond with the number of dispatch addresses above.', 729 values=[1, 2, 3, 4], 730 required = False, 731 readonly = False, 732 default = 1, 715 733 ) 716 734 -
main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py
r14302 r14306 29 29 from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget 30 30 from waeup.kofa.interfaces import ( 31 IKofaUtils, academic_sessions_vocab, ICSVExporter) 32 from waeup.kofa.students.interfaces import IStudentsUtils, IStudent 31 IKofaUtils, academic_sessions_vocab, ICSVExporter, IKofaObject) 32 from waeup.kofa.students.interfaces import ( 33 IStudentsUtils, IStudent, IStudentRequestPW) 33 34 from waeup.kofa.students.workflow import PAID, REGISTERED, RETURNING 34 35 from waeup.kofa.students.studylevel import getGradeWeightFromScore … … 51 52 StudyCourseTranscriptPage, 52 53 DownloadScoresView, 54 StudentRequestPasswordPage 53 55 ) 54 56 from kofacustom.nigeria.students.browser import ( … … 81 83 from waeup.aaue.interswitch.browser import gateway_net_amt 82 84 from waeup.aaue.interfaces import MessageFactory as _ 85 86 grok.context(IKofaObject) # Make IKofaObject the default context 83 87 84 88 class CustomStudentBaseDisplayFormPage(NigeriaStudentBaseDisplayFormPage): … … 866 870 code=self.context.code) 867 871 return 872 873 class AlumniRequestPasswordPage(StudentRequestPasswordPage): 874 """Captcha'd request password page for students. 875 """ 876 grok.name('alumni_requestpw') 877 grok.require('waeup.Anonymous') 878 grok.template('alumni_requestpw') 879 form_fields = grok.AutoFields(IStudentRequestPW).select( 880 'lastname','number','email') 881 label = _('Search student record and send password for first-time login') 882 883 def _redirect_no_student(self): 884 self.flash(_('No student record found.'), type="warning") 885 self.redirect(self.application_url() + '/applicants/trans2017/register') 886 return -
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r14288 r14306 38 38 from waeup.kofa.authentication import LocalRoleSetEvent 39 39 from waeup.kofa.browser.tests.test_pdf import samples_dir 40 from waeup.kofa.applicants.container import ApplicantsContainer 40 41 from waeup.aaue.testing import FunctionalLayer 41 42 … … 1107 1108 self.assertEqual(self.browser.headers['Status'], '200 Ok') 1108 1109 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 1110 1111 def test_alumni_request_pw(self): 1112 # Add an applicants container 1113 applicantscontainer = ApplicantsContainer() 1114 applicantscontainer.code = u'trans2017' 1115 applicantscontainer.prefix = 'trans' 1116 applicantscontainer.year = 2017 1117 applicantscontainer.title = u'This is the trans2017 container' 1118 applicantscontainer.application_category = 'no' 1119 applicantscontainer.mode = 'create' 1120 applicantscontainer.strict_deadline = True 1121 delta = timedelta(days=10) 1122 applicantscontainer.startdate = datetime.now(pytz.utc) - delta 1123 applicantscontainer.enddate = datetime.now(pytz.utc) + delta 1124 self.app['applicants']['trans2017'] = applicantscontainer 1125 self.applicantscontainer = self.app['applicants']['trans2017'] 1126 # Student with wrong number can't be found. 1127 # Applicant is redirected to application section. 1128 self.browser.open('http://localhost/app/alumni_requestpw') 1129 self.browser.getControl(name="form.lastname").value = 'Tester' 1130 self.browser.getControl(name="form.number").value = 'anynumber' 1131 self.browser.getControl(name="form.email").value = 'xx@yy.zz' 1132 self.browser.getControl("Send login credentials").click() 1133 self.assertTrue('No student record found.' 1134 in self.browser.contents) 1135 self.assertEqual(self.browser.url, 1136 'http://localhost/app/applicants/trans2017/register')
Note: See TracChangeset for help on using the changeset viewer.