Changeset 13979


Ignore:
Timestamp:
23 Jun 2016, 10:05:58 (9 years ago)
Author:
Henrik Bettermann
Message:

Do not export all attributes. Adjust test.

Location:
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/export.py

    r13155 r13979  
    2121from waeup.kofa.applicants.interfaces import IApplicantBaseData
    2222from waeup.kofa.applicants.export import ApplicantExporter
     23from waeup.kofa.utils.helpers import iface_names
    2324from kofacustom.nigeria.applicants.interfaces import (
    2425    INigeriaUGApplicant, INigeriaPGApplicant)
     
    3132    # and attributes of the interfaces.
    3233    fields = tuple(sorted(set(
    33         INigeriaUGApplicant.names() +
    34         INigeriaPGApplicant.names() +
    35         IApplicantBaseData.names()
    36         )))
     34        iface_names(INigeriaUGApplicant) +
     35        iface_names(INigeriaPGApplicant) +
     36        iface_names(IApplicantBaseData)
     37        ))) + (
     38        'password', 'state', 'history', 'container_code', 'application_number',
     39        'display_fullname', 'application_date')
    3740
    3841    def mangle_value(self, value, name, context=None):
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/tests/test_browser.py

    r13561 r13979  
    432432        result = open(self.outfile, 'rb').read()
    433433        self.assertMatches(result,
    434             'aggregate,applicant_id,application_date,application_number,'
    435             'container_code,course1,course2,course_admitted,date_of_birth,'
    436             'display_fullname,email,emp2_end,emp2_position,emp2_reason,'
     434            'aggregate,applicant_id,course1,course2,course_admitted,'
     435            'date_of_birth,email,emp2_end,emp2_position,emp2_reason,'
    437436            'emp2_start,emp_end,emp_position,emp_reason,emp_start,employer,'
    438437            'employer2,firstname,fst_sit_date,fst_sit_fname,fst_sit_no,'
    439             'fst_sit_results,fst_sit_type,history,hq_degree,hq_disc,'
    440             'hq_fname,'
     438            'fst_sit_results,fst_sit_type,hq_degree,hq_disc,hq_fname,'
    441439            'hq_matric_no,hq_school,hq_session,hq_type,jamb_reg_number,'
    442             'jamb_score,jamb_subjects,jamb_subjects_list,'
    443             'lastname,lga,locked,middlename,'
    444             'nationality,notice,nysc_lga,nysc_year,password,phone,'
    445             'presently_inst,programme_type,reg_number,result_uploaded,scd_sit_date,'
    446             'scd_sit_fname,scd_sit_no,scd_sit_results,scd_sit_type,'
    447             'screening_date,screening_score,screening_venue,sex,special,'
    448             'special_application,state,student_id,suspended,translated_state\r\n'
    449 
    450             ',dp2011_654321,,654321,dp2011,CERT1,CERT1,CERT1,1981-02-04#,'
    451             'Anna M. Tester,anna@sample.com,,,,,,,,,,,Anna,,,,,,'
    452             '[u\'2015-07-06 11:21:22 WAT - Application initialized by system\']'
    453             ',,,,,,,,,,Line 1++Line 2,"[\'english_language\', \'fine_art\']",'
     440            'jamb_score,jamb_subjects,jamb_subjects_list,lastname,lga,'
     441            'locked,middlename,nationality,notice,nysc_lga,nysc_year,'
     442            'phone,presently_inst,programme_type,reg_number,result_uploaded,'
     443            'scd_sit_date,scd_sit_fname,scd_sit_no,scd_sit_results,'
     444            'scd_sit_type,screening_date,screening_score,screening_venue,'
     445            'sex,special_application,student_id,suspended,password,state,'
     446            'history,container_code,application_number,display_fullname,'
     447            'application_date\r\n'
     448
     449            ',dp2011_654321,CERT1,CERT1,CERT1,1981-02-04#,'
     450            'anna@sample.com,,,,,,,,,,,Anna,,,,,,,,,,,,,,,'
     451            'Line 1++Line 2,"[\'english_language\', \'fine_art\']",'
    454452            'Tester,,0,M.,NG,"Some notice\nin lines.",,,'
    455             'any password,+234-123-12345#,,,123456,,,,,,,'
     453            '+234-123-12345#,,,123456,,,,,,,'
    456454            '"Saturday, 16th June 2012 2:00:00 PM",98,Exam Room,f,,,'
    457             'initialized,,0,initialized\r\n')
     455            '0,any password,initialized,'
     456            '[u\'2016-06-23 10:58:23 WAT - Application initialized by system\'],'
     457            'dp2011,654321,Anna M. Tester,\r\n')
    458458        # We can import the same file if we ignore some columns.
    459459        # Since the applicants_catalog hasn't been notified, the same
     
    462462        result = processor.doImport(
    463463            self.outfile,
    464             ['aggregate','ignore_applicant_id','application_date','ignore_application_number',
    465             'container_code','course1','course2','course_admitted','date_of_birth',
    466             'display_fullname','email','emp2_end','emp2_position','emp2_reason',
     464            [
     465            'aggregate','ignore_applicant_id','course1','course2','course_admitted',
     466            'date_of_birth','email','emp2_end','emp2_position','emp2_reason',
    467467            'emp2_start','emp_end','emp_position','emp_reason','emp_start','employer',
    468468            'employer2','firstname','fst_sit_date','fst_sit_fname','fst_sit_no',
    469             'fst_sit_results','fst_sit_type','history','hq_degree','hq_disc',
    470             'hq_fname',
     469            'fst_sit_results','fst_sit_type','hq_degree','hq_disc','hq_fname',
    471470            'hq_matric_no','hq_school','hq_session','hq_type','jamb_reg_number',
    472             'jamb_score','jamb_subjects','jamb_subjects_list',
    473             'lastname','lga','locked','middlename',
    474             'nationality','notice','nysc_lga','nysc_year','password','phone',
    475             'presently_inst','programme_type','reg_number','result_uploaded','scd_sit_date',
    476             'scd_sit_fname','scd_sit_no','scd_sit_results','scd_sit_type',
    477             'screening_date','screening_score','screening_venue','sex','special',
    478             'special_application','state','student_id','suspended',
    479             'translated_state'],
     471            'jamb_score','jamb_subjects','jamb_subjects_list','lastname','lga',
     472            'locked','middlename','nationality','notice','nysc_lga','nysc_year',
     473            'phone','presently_inst','programme_type','reg_number','result_uploaded',
     474            'scd_sit_date','scd_sit_fname','scd_sit_no','scd_sit_results',
     475            'scd_sit_type','screening_date','screening_score','screening_venue',
     476            'sex','special_application','student_id','suspended','password','state',
     477            'ignore_history','container_code','ignore_application_number','display_fullname',
     478            'application_date'
     479            ],
    480480            mode='create')
    481481        num_succ, num_fail, finished_path, failed_path = result
     
    491491        result = processor.doImport(
    492492            self.outfile,
    493             ['aggregate','ignore_applicant_id','application_date','ignore_application_number',
    494             'ignore_container_code','course1','course2','course_admitted','date_of_birth',
    495             'display_fullname','email','emp2_end','emp2_position','emp2_reason',
     493            [
     494            'aggregate','ignore_applicant_id','course1','course2','course_admitted',
     495            'date_of_birth','email','emp2_end','emp2_position','emp2_reason',
    496496            'emp2_start','emp_end','emp_position','emp_reason','emp_start','employer',
    497497            'employer2','firstname','fst_sit_date','fst_sit_fname','fst_sit_no',
    498             'fst_sit_results','fst_sit_type','history','hq_degree','hq_disc',
    499             'hq_fname',
     498            'fst_sit_results','fst_sit_type','hq_degree','hq_disc','hq_fname',
    500499            'hq_matric_no','hq_school','hq_session','hq_type','jamb_reg_number',
    501             'jamb_score','jamb_subjects','jamb_subjects_list',
    502             'lastname','lga','locked','middlename',
    503             'nationality','notice','nysc_lga','nysc_year','password','phone',
    504             'presently_inst','programme_type','reg_number','result_uploaded','scd_sit_date',
    505             'scd_sit_fname','scd_sit_no','scd_sit_results','scd_sit_type',
    506             'screening_date','screening_score','screening_venue','sex','special',
    507             'special_application','state','student_id','suspended',
    508             'translated_state'],
     500            'jamb_score','jamb_subjects','jamb_subjects_list','lastname','lga',
     501            'locked','middlename','nationality','notice','nysc_lga','nysc_year',
     502            'phone','presently_inst','programme_type','reg_number','result_uploaded',
     503            'scd_sit_date','scd_sit_fname','scd_sit_no','scd_sit_results',
     504            'scd_sit_type','screening_date','screening_score','screening_venue',
     505            'sex','special_application','student_id','suspended','password','state',
     506            'ignore_history','ignore_container_code','ignore_application_number',
     507            'display_fullname','application_date'
     508            ],
    509509            mode='update')
    510510        num_succ, num_fail, finished_path, failed_path = result
Note: See TracChangeset for help on using the changeset viewer.