Changeset 16186


Ignore:
Timestamp:
4 Aug 2020, 07:49:51 (4 years ago)
Author:
Henrik Bettermann
Message:

reg_number is no longer a required field in IApplicantBaseData.

Add entry_session to student data exporters.

Location:
main/waeup.kofa/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/CHANGES.txt

    r16170 r16186  
    441.6.1.dev0 (unreleased)
    55=======================
     6
     7* `reg_number` is no longer a required field in `IApplicantBaseData`.
     8
     9* Add `entry_session` to student data exporters.
    610
    711* Add `DownloadTranscript` permission.
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py

    r16134 r16186  
    379379        title = _(u'Registration Number'),
    380380        readonly = False,
    381         required = True,
     381        required = False,
    382382        source = contextual_reg_num_source,
    383383        )
  • main/waeup.kofa/trunk/src/waeup/kofa/students/export.py

    r16006 r16186  
    328328    fields = tuple(sorted(iface_names(IStudent))) + (
    329329        'password', 'state', 'history', 'certcode', 'is_postgrad',
    330         'current_level', 'current_session')
     330        'current_level', 'current_session', 'entry_session')
    331331    title = _(u'Students (Data Backup)')
    332332
     
    371371        'current_level',
    372372        'current_session',
    373         'current_verdict')
     373        'current_verdict',
     374        'entry_session')
    374375    title = _(u'Students (Trimmed Data)')
    375376
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r16120 r16186  
    39533953            'sex,student_id,suspended,suspended_comment,'
    39543954            'password,state,history,certcode,is_postgrad,'
    3955             'current_level,current_session\r\n'
     3955            'current_level,current_session,entry_session\r\n'
    39563956            ',,1981-02-04#,aa@aa.ng,,Anna,,Tester,234,,,,,,,'
    39573957            '1234#,123,m,K1000000,0,,{SSHA}' in self.browser.contents)
     
    40844084            'sex,student_id,suspended,suspended_comment,'
    40854085            'password,state,history,certcode,is_postgrad,'
    4086             'current_level,current_session\r\n'
     4086            'current_level,current_session,entry_session\r\n'
    40874087            ',,1981-02-04#,aa@aa.ng,,Anna,,Tester,234,,,,,,,'
    40884088            '1234#,123,m,K1000000,0,,{SSHA}' in self.browser.contents)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r15979 r16186  
    168168            'perm_address,personal_updated,'
    169169            'phone,reg_number,sex,student_id,suspended,suspended_comment,'
    170             'password,state,history,'
    171             'certcode,is_postgrad,current_level,current_session\r\n'
     170            'password,state,history,certcode,is_postgrad,'
     171            'current_level,current_session,entry_session\r\n'
    172172            'my adm code,my clr code,'
    173173            '1981-02-04#,anna@sample.com,,Anna,,Tester,234,M.,NG,,,'
    174174            '"Studentroad 21\nLagos 123456\n",,+234-123-12345#,123,f,'
    175175            'A111111,0,,,created'
    176             in result
    177             )
    178         return
    179 
    180 
    181 class StudentTrimmedDataExporterTest(StudentImportExportSetup):
    182 
    183     layer = FunctionalLayer
    184 
    185     std_csv_entry = (
    186         'my adm code,my clr code,1981-02-04#,anna@sample.com,,'
    187         'Anna,,Tester,234,M.,NG,,,"Studentroad 21\nLagos 123456\n",,'
    188         '+234-123-12345#,123,f,A111111,0,,,created'
    189         )
    190 
    191     def setUp(self):
    192         super(StudentTrimmedDataExporterTest, self).setUp()
    193         self.setup_for_export()
    194         return
    195 
    196     def test_ifaces(self):
    197         # make sure we fullfill interface contracts
    198         obj = TrimmedDataExporter()
    199         verifyObject(ICSVStudentExporter, obj)
    200         verifyClass(ICSVStudentExporter, TrimmedDataExporter)
    201         return
    202 
    203     def test_get_as_utility(self):
    204         # we can get an student exporter as utility
    205         result = queryUtility(ICSVExporter, name="trimmed")
    206         self.assertTrue(result is not None)
    207         return
    208 
    209     def test_export(self):
    210         # we can really export students
    211         # set values we can expect in export file
    212         self.setup_student(self.student)
    213         exporter = TrimmedDataExporter()
    214         exporter.export([self.student], self.outfile)
    215         result = open(self.outfile, 'rb').read()
    216         self.assertTrue(
    217             'student_id,matric_number,reg_number,firstname,middlename,'
    218             'lastname,sex,email,phone,nationality,date_of_birth,state,'
    219             'current_mode,certcode,faccode,depcode,current_level,'
    220             'current_session,current_verdict\r\n'
    221             'A111111,234,123,Anna,M.,Tester,f,anna@sample.com,+234-123-12345#,'
    222             'NG,1981-02-04#,created,ug_ft,CERT1,NA,NA,200,2012,0'
    223176            in result
    224177            )
     
    238191            'perm_address,personal_updated,'
    239192            'phone,reg_number,sex,student_id,suspended,suspended_comment,'
    240             'password,state,history,certcode,'
    241             'is_postgrad,current_level,current_session\r\n'
     193            'password,state,history,certcode,is_postgrad,'
     194            'current_level,current_session,entry_session\r\n'
    242195            'my adm code,my clr code,1981-02-04#,anna@sample.com,,'
    243196            'Anna,,Tester,234,M.,NG,,,"Studentroad 21\nLagos 123456\n"'
     
    259212            'perm_address,personal_updated,'
    260213            'phone,reg_number,sex,student_id,suspended,suspended_comment,'
    261             'password,state,history,certcode,'
    262             'is_postgrad,current_level,current_session\r\n'
     214            'password,state,history,certcode,is_postgrad,'
     215            'current_level,current_session,entry_session\r\n'
    263216            'my adm code,my clr code,1981-02-04#,anna@sample.com,,'
    264217            'Anna,,Tester,234,M.,NG,,,"Studentroad 21\nLagos 123456\n"'
     
    373326        self.assertTrue(self.std_csv_entry in result1)
    374327        self.assertTrue(self.std_csv_entry not in result2)
     328        return
     329
     330
     331
     332class StudentTrimmedDataExporterTest(StudentImportExportSetup):
     333
     334    layer = FunctionalLayer
     335
     336    std_csv_entry = (
     337        'my adm code,my clr code,1981-02-04#,anna@sample.com,,'
     338        'Anna,,Tester,234,M.,NG,,,"Studentroad 21\nLagos 123456\n",,'
     339        '+234-123-12345#,123,f,A111111,0,,,created'
     340        )
     341
     342    def setUp(self):
     343        super(StudentTrimmedDataExporterTest, self).setUp()
     344        self.setup_for_export()
     345        return
     346
     347    def test_ifaces(self):
     348        # make sure we fullfill interface contracts
     349        obj = TrimmedDataExporter()
     350        verifyObject(ICSVStudentExporter, obj)
     351        verifyClass(ICSVStudentExporter, TrimmedDataExporter)
     352        return
     353
     354    def test_get_as_utility(self):
     355        # we can get an student exporter as utility
     356        result = queryUtility(ICSVExporter, name="trimmed")
     357        self.assertTrue(result is not None)
     358        return
     359
     360    def test_export_all(self):
     361        # we can really export students
     362        # set values we can expect in export file
     363        self.setup_student(self.student)
     364        exporter = TrimmedDataExporter()
     365        exporter.export_all(self.app, self.outfile)
     366        result = open(self.outfile, 'rb').read()
     367        self.assertTrue(
     368            'student_id,matric_number,reg_number,firstname,middlename,'
     369            'lastname,sex,email,phone,nationality,date_of_birth,state,'
     370            'current_mode,certcode,faccode,depcode,current_level,'
     371            'current_session,current_verdict,entry_session\r\n'
     372            'A111111,234,123,Anna,M.,Tester,f,anna@sample.com,+234-123-12345#,'
     373            'NG,1981-02-04#,created,ug_ft,CERT1,NA,NA,200,2012,0,2010'
     374            in result
     375            )
    375376        return
    376377
Note: See TracChangeset for help on using the changeset viewer.