Changeset 7795 for main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Timestamp:
- 8 Mar 2012, 03:30:30 (13 years ago)
- Location:
- main/waeup.sirp/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk
- Property svn:mergeinfo changed
/main/waeup.sirp/branches/ulif-schoolgrades (added) merged: 7761-7774,7778-7794
- Property svn:mergeinfo changed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py
r7708 r7795 18 18 """Interfaces of the university application package. 19 19 """ 20 21 20 from grokcore.content.interfaces import IContainer 22 21 from zc.sourcefactory.basic import BasicSourceFactory 22 from zc.sourcefactory.contextual import BasicContextualSourceFactory 23 23 from zope import schema 24 from zope.interface import Interface, Attribute, implements, directlyProvides25 24 from zope.component import getUtilitiesFor, queryUtility, getUtility 26 25 from zope.catalog.interfaces import ICatalog 26 from zope.interface import Interface, Attribute, implements, directlyProvides 27 27 from zope.schema.interfaces import ( 28 28 ValidationError, ISource, IContextSourceBinder) 29 from zc.sourcefactory.basic import BasicSourceFactory30 from zc.sourcefactory.contextual import BasicContextualSourceFactory31 29 from waeup.sirp.schema import TextLineChoice 32 30 from waeup.sirp.interfaces import ( 33 31 ISIRPObject, year_range, validate_email, academic_sessions_vocab) 34 32 from waeup.sirp.interfaces import MessageFactory as _ 33 from waeup.sirp.payments.interfaces import IOnlinePayment 34 from waeup.sirp.schoolgrades import ResultEntryField 35 from waeup.sirp.students.vocabularies import ( 36 lgas_vocab, CertificateSource, GenderSource) 35 37 from waeup.sirp.university.vocabularies import ( 36 38 course_levels, AppCatSource) 37 from waeup.sirp.students.vocabularies import (38 lgas_vocab, CertificateSource, GenderSource)39 from waeup.sirp.payments.interfaces import IOnlinePayment40 39 41 40 #: Maximum upload size for applicant passport photographs (in bytes) … … 77 76 return source 78 77 directlyProvides(contextual_reg_num_source, IContextSourceBinder) 78 79 79 80 80 class AppCatCertificateSource(CertificateSource): … … 360 360 state, depending on use-case. 361 361 362 This base interface is also implemented by the StudentApplication363 class in the students package. Thus, these are the data which are saved364 after admission.365 """366 362 This base interface is also implemented by the 363 :class:`waeup.sirp.students.StudentApplication` class in the 364 students package. Thus, these are the data which are saved after 365 admission. 366 """ 367 367 applicant_id = schema.TextLine( 368 368 title = _(u'Applicant Id'), … … 430 430 required = False, 431 431 ) 432 school_grades = schema.List( 433 title = _(u'School Grades'), 434 value_type = ResultEntryField(), 435 required = True, 436 default = [], 437 ) 432 438 433 439 # -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py
r7685 r7795 752 752 self.browser.open(self.edit_path) 753 753 self.assertTrue( 754 '<option selected="selected" value="CERT1">' in self.browser.contents) 754 '<option selected="selected" value="CERT1">' 755 in self.browser.contents) 756 757 def test_school_grades(self): 758 # we can add school grades 759 self.login() 760 self.browser.open(self.edit_path) 761 self.fill_correct_values() # Fill other fields 762 # add a new (empty) row with subject/grade 763 self.browser.getControl(name="form.school_grades.add").click() 764 # pick first subject (after <no value>)... 765 ctrl_subj = self.browser.getControl( 766 name="form.school_grades.0.subject") 767 ctrl_subj.value = [ctrl_subj.options[1]] 768 display_subj = ctrl_subj.displayOptions[1] 769 # pick first grade (after <no value>)... 770 ctrl_grade = self.browser.getControl( 771 name="form.school_grades.0.grade") 772 ctrl_grade.value = [ctrl_grade.options[1]] 773 display_grade = ctrl_grade.displayOptions[1] 774 # save everything 775 self.browser.getControl("Save").click() 776 self.assertTrue( 777 '<input type="hidden" name="form.school_grades.count" value="1" />' 778 in self.browser.contents) 779 # we can also see the new subject/grade in display view 780 self.browser.open(self.view_path) 781 self.assertTrue( 782 display_subj in self.browser.contents) 783 self.assertTrue( 784 display_grade in self.browser.contents) 785 return 755 786 756 787 class ApplicantRegisterTests(ApplicantsFullSetup):
Note: See TracChangeset for help on using the changeset viewer.