Changeset 15045
- Timestamp:
- 11 Jun 2018, 07:29:33 (7 years ago)
- Location:
- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/interfaces.py
r14828 r15045 37 37 from waeup.kofa.students.vocabularies import nats_vocab, GenderSource 38 38 from kofacustom.nigeria.interfaces import ( 39 LGASource, high_qual, high_grade, exam_types )39 LGASource, high_qual, high_grade, exam_types, validate_jamb_reg_number) 40 40 from kofacustom.nigeria.interfaces import MessageFactory as _ 41 41 from kofacustom.nigeria.payments.interfaces import INigeriaOnlinePayment … … 357 357 title = _(u'JAMB Registration Number'), 358 358 required = False, 359 constraint=validate_jamb_reg_number, 359 360 ) 360 361 notice = schema.Text( -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interfaces.py
r14866 r15045 17 17 ## 18 18 19 import re 19 20 import zope.i18nmessageid 20 21 from zope import schema … … 76 77 ) 77 78 79 # Define a validation method for JAMB reg numbers 80 class NotJAMBRegNumber(schema.ValidationError): 81 __doc__ = u"Invalid JAMB registration number" 82 83 #: Regular expression to check jamb_reg_number formats. 84 check_jamb_reg_number = re.compile(r"^[A-Z]{2}\d{8}$").match 85 86 def validate_jamb_reg_number(value): 87 if not check_jamb_reg_number(value): 88 raise NotJAMBRegNumber(value) 89 return True 90 78 91 #lgas_vocab = SimpleKofaVocabulary( 79 92 # *sorted([(x[1],x[0]) for x in LGAS])) -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_export.py
r14741 r15045 29 29 from kofacustom.nigeria.testing import FunctionalLayer 30 30 31 curr_year = datetime.datetime.now().year 31 32 32 33 class NigeriaStudentExporterTest(StudentImportExportSetup): … … 115 116 # set values we can expect in export file 116 117 self.setup_student(self.student) 117 self.student['payments']['my-payment'].r_company = 'intersw atch'118 self.student['payments']['my-payment'].r_company = 'interswitch' 118 119 self.student['payments']['my-payment'].r_card_num = '789' 119 120 exporter = NigeriaStudentPaymentExporter() … … 127 128 'current_session\r\n' 128 129 '666,12.12,2012-04-01 13:12:01#,,schoolfee,1,my-id,p-item,' 129 '100, 2011,paid,2012-04-01 14:12:01#,,12.12,'130 '789,r-code,intersw atch,,,,A111111,created,2012\r\n',130 '100,%s,paid,2012-04-01 14:12:01#,,12.12,' 131 '789,r-code,interswitch,,,,A111111,created,2012\r\n' % (curr_year-6), 131 132 result 132 133 )
Note: See TracChangeset for help on using the changeset viewer.