source: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/tests/test_browser.py @ 13621

Last change on this file since 13621 was 13561, checked in by Henrik Bettermann, 9 years ago

Allow to skip the subjects list field.

  • Property svn:keywords set to Id
File size: 25.8 KB
Line 
1## $Id: test_browser.py 13561 2015-12-22 07:25:36Z henrik $
2##
3## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17##
18import os
19import shutil
20import tempfile
21import datetime
22import grok
23import pytz
24from zope.event import notify
25from zope.intid.interfaces import IIntIds
26from zope.interface.verify import verifyClass, verifyObject
27from zope.schema.interfaces import ConstraintNotSatisfied
28from zope.component.hooks import setSite, clearSite
29from zope.component import createObject, getUtility
30from zope.catalog.interfaces import ICatalog
31from zope.testbrowser.testing import Browser
32from hurry.workflow.interfaces import IWorkflowState
33from waeup.kofa.app import University
34from waeup.kofa.university.faculty import Faculty
35from waeup.kofa.university.department import Department
36from waeup.kofa.testing import FunctionalTestCase
37from waeup.kofa.configuration import SessionConfiguration
38from waeup.kofa.applicants.container import ApplicantsContainer
39from waeup.kofa.applicants.tests.test_batching import ApplicantImportExportSetup
40from waeup.kofa.interfaces import IBatchProcessor, IUserAccount
41from kofacustom.nigeria.testing import FunctionalLayer
42from kofacustom.nigeria.applicants.export import NigeriaApplicantExporter
43from kofacustom.nigeria.applicants.batching import NigeriaApplicantProcessor
44
45session_1 = datetime.datetime.now().year - 2
46app_container_name = u'app%s' % session_1
47pgft_container_name = u'pgft%s' % session_1
48cbt_container_name = u'cbt%s' % session_1
49
50class ApplicantUITest(FunctionalTestCase):
51    """Perform some browser tests.
52    """
53    layer = FunctionalLayer
54
55    def setUp(self):
56        super(ApplicantUITest, self).setUp()
57        # Setup a sample site for each test
58        app = University()
59        self.dc_root = tempfile.mkdtemp()
60        app['datacenter'].setStoragePath(self.dc_root)
61
62        # Prepopulate the ZODB...
63        self.getRootFolder()['app'] = app
64        # we add the site immediately after creation to the
65        # ZODB. Catalogs and other local utilities are not setup
66        # before that step.
67        self.app = self.getRootFolder()['app']
68        # Set site here. Some of the following setup code might need
69        # to access grok.getSite() and should get our new app then
70        setSite(app)
71
72        # Add three different applicants containers
73        self.pgcontainer = ApplicantsContainer()
74        self.pgcontainer.code = pgft_container_name
75        self.pgcontainer.prefix = u'pgft'
76        self.pgcontainer.application_category = u'pg_ft'
77        self.pgcontainer.year = session_1
78        self.pgcontainer.application_fee = 300.0
79        self.pgcontainer.title = u'This is the %s container' % pgft_container_name
80        self.app['applicants'][pgft_container_name] = self.pgcontainer
81
82        self.ugcontainer = ApplicantsContainer()
83        self.ugcontainer.code = app_container_name
84        self.ugcontainer.prefix = u'app'
85        self.ugcontainer.application_category = u'basic'
86        self.ugcontainer.year = session_1
87        self.ugcontainer.application_fee = 200.0
88        self.ugcontainer.title = u'This is the %s container' % app_container_name
89        self.app['applicants'][app_container_name] = self.ugcontainer
90        self.ugcontainer.mode = 'update'
91        delta = datetime.timedelta(days=10)
92        self.ugcontainer.startdate = datetime.datetime.now(pytz.utc) - delta
93        self.ugcontainer.enddate = datetime.datetime.now(pytz.utc) + delta
94
95        self.cbtcontainer = ApplicantsContainer()
96        self.cbtcontainer.code = cbt_container_name
97        self.cbtcontainer.prefix = u'cbt'
98        self.cbtcontainer.application_category = u'basic'
99        self.cbtcontainer.year = session_1
100        self.cbtcontainer.application_fee = 300.0
101        self.cbtcontainer.title = u'This is the %s container' % cbt_container_name
102        self.app['applicants'][cbt_container_name] = self.cbtcontainer
103        self.cbtcontainer.mode = 'update'
104        delta = datetime.timedelta(days=10)
105        self.cbtcontainer.startdate = datetime.datetime.now(pytz.utc) - delta
106        self.cbtcontainer.enddate = datetime.datetime.now(pytz.utc) + delta
107
108        # Populate university
109        self.certificate = createObject('waeup.Certificate')
110        self.certificate.code = 'CERT1'
111        self.certificate.application_category = 'basic'
112        self.certificate.start_level = 100
113        self.certificate.end_level = 500
114        self.certificate.study_mode = u'ug_ft'
115        self.app['faculties']['fac1'] = Faculty()
116        self.app['faculties']['fac1']['dep1'] = Department()
117        self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
118            self.certificate)
119        self.certificate2 = createObject('waeup.Certificate')
120        self.certificate2.code = 'CERT2'
121        self.certificate2.application_category = 'pg_ft'
122        self.certificate2.start_level = 100
123        self.certificate2.end_level = 500
124        self.certificate.study_mode = u'pg_ft'
125        self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
126            self.certificate2)
127
128        # Add (customized) applicants
129        pgapplicant = createObject(u'waeup.Applicant')
130        pgapplicant.firstname = u'Anna'
131        pgapplicant.lastname = u'Post'
132        self.app['applicants'][pgft_container_name].addApplicant(pgapplicant)
133        self.pgapplication_number = pgapplicant.application_number
134        self.pgapplicant = self.app['applicants'][pgft_container_name][
135            self.pgapplication_number]
136
137        ugapplicant = createObject(u'waeup.Applicant')
138        ugapplicant.firstname = u'Klaus'
139        ugapplicant.lastname = u'Under'
140        self.app['applicants'][app_container_name].addApplicant(ugapplicant)
141        self.ugapplication_number = ugapplicant.application_number
142        self.ugapplicant = self.app['applicants'][app_container_name][
143            self.ugapplication_number]
144
145        cbtapplicant = createObject(u'waeup.Applicant')
146        cbtapplicant.firstname = u'Anna'
147        cbtapplicant.lastname = u'Cbt'
148        self.app['applicants'][cbt_container_name].addApplicant(cbtapplicant)
149        self.cbtapplication_number = cbtapplicant.application_number
150        self.cbtapplicant = self.app['applicants'][cbt_container_name][
151            self.cbtapplication_number]
152        IUserAccount(self.cbtapplicant).setPassword('apwd')
153
154        self.login_path = 'http://localhost/app/login'
155        self.logout_path = 'http://localhost/app/logout'
156        self.pgapplicant_path = ('http://localhost/app/applicants/%s/%s'
157            % (pgft_container_name, self.pgapplication_number))
158        self.ugapplicant_path = ('http://localhost/app/applicants/%s/%s'
159            % (app_container_name, self.ugapplication_number))
160        self.cbtapplicant_path = ('http://localhost/app/applicants/%s/%s'
161            % (cbt_container_name, self.cbtapplication_number))
162
163        self.browser = Browser()
164        self.browser.handleErrors = False
165
166        configuration = SessionConfiguration()
167        configuration.academic_session = session_1
168        configuration.application_fee = 200.0
169        self.app['configuration'].addSessionConfiguration(configuration)
170
171    def tearDown(self):
172        super(ApplicantUITest, self).tearDown()
173        shutil.rmtree(self.dc_root)
174        clearSite()
175        return
176
177    def fill_correct_values(self):
178        self.browser.getControl(name="form.reg_number").value = '1234'
179        self.browser.getControl(name="form.firstname").value = 'John'
180        self.browser.getControl(name="form.lastname").value = 'Tester'
181        self.browser.getControl(name="form.date_of_birth").value = '09/09/1988'
182        self.browser.getControl(name="form.lga").value = ['foreigner']
183        self.browser.getControl(name="form.nationality").value = ['NG']
184        self.browser.getControl(name="form.sex").value = ['m']
185        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
186
187    def test_manage_and_view_applicant(self):
188        # Managers can manage pg applicants.
189        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
190        # The IPGApplicant interface is really used in all pages.
191        self.browser.open(self.pgapplicant_path)
192        self.assertEqual(self.browser.headers['Status'], '200 Ok')
193        self.assertTrue('Employer' in self.browser.contents)
194        self.browser.open(self.pgapplicant_path + '/manage')
195        self.assertEqual(self.browser.headers['Status'], '200 Ok')
196        self.assertTrue('Employer' in self.browser.contents)
197        self.browser.open(self.pgapplicant_path + '/edit')
198        self.assertEqual(self.browser.headers['Status'], '200 Ok')
199        self.assertTrue('Employer' in self.browser.contents)
200        self.browser.open(self.pgapplicant_path + '/application_slip.pdf')
201        self.assertEqual(self.browser.headers['Status'], '200 Ok')
202        # If we view the applicant in the ug container,
203        # the employer field doesn't appear.
204        self.browser.open(self.ugapplicant_path)
205        self.assertEqual(self.browser.headers['Status'], '200 Ok')
206        self.assertFalse('Employer' in self.browser.contents)
207        self.browser.open(self.ugapplicant_path + '/manage')
208        self.assertEqual(self.browser.headers['Status'], '200 Ok')
209        # We can save the applicant.
210        self.fill_correct_values()
211        self.browser.getControl(name="form.course1").value = ['CERT1']
212        self.browser.getControl("Save").click()
213        self.assertMatches('...Form has been saved...', self.browser.contents)
214        self.assertFalse('Employer' in self.browser.contents)
215        self.browser.open(self.ugapplicant_path + '/edit')
216        self.assertEqual(self.browser.headers['Status'], '200 Ok')
217        self.assertFalse('Employer' in self.browser.contents)
218        self.browser.open(self.ugapplicant_path + '/application_slip.pdf')
219        self.assertEqual(self.browser.headers['Status'], '200 Ok')
220        return
221
222    def test_set_wrong_course1(self):
223        self.ugapplicant.course1 = self.certificate
224        self.assertRaises(
225            ConstraintNotSatisfied,
226            setattr, self.ugapplicant, 'course1', self.certificate2)
227        self.pgapplicant.course1 = self.certificate2
228        self.assertRaises(
229            ConstraintNotSatisfied,
230            setattr, self.pgapplicant, 'course1', self.certificate)
231        return
232
233    def test_application_payment(self):
234        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
235
236        # UG (UTME) applicant
237        self.browser.open(self.ugapplicant_path)
238        self.browser.open(self.ugapplicant_path + '/manage')
239        self.assertEqual(self.browser.headers['Status'], '200 Ok')
240        self.fill_correct_values()
241        self.browser.getControl(name="form.course1").value = ['CERT1']
242        self.browser.getControl("Save").click()
243        self.assertMatches('...Form has been saved...', self.browser.contents)
244        self.browser.getControl("Add online payment ticket").click()
245        self.assertMatches('...Payment ticket created...',
246                           self.browser.contents)
247        self.assertMatches('...Amount Authorized...',
248                           self.browser.contents)
249        payment_id = self.ugapplicant.keys()[0]
250        payment = self.ugapplicant[payment_id]
251        self.assertEqual(payment.p_item,'This is the %s container' % app_container_name)
252        self.assertEqual(payment.p_session,session_1)
253        self.assertEqual(payment.p_category,'application')
254        self.assertEqual(payment.amount_auth, 200.0)
255
256        # PG applicants pay more
257        self.browser.open(self.pgapplicant_path)
258        self.browser.open(self.pgapplicant_path + '/manage')
259        self.assertEqual(self.browser.headers['Status'], '200 Ok')
260        self.fill_correct_values()
261        self.browser.getControl(name="form.course1").value = ['CERT2']
262        self.browser.getControl(name="form.reg_number").value = '2345'
263        self.browser.getControl(name="form.firstname").value = 'Anna'
264        self.browser.getControl("Save").click()
265        self.assertMatches('...Form has been saved...', self.browser.contents)
266        self.browser.getControl("Add online payment ticket").click()
267        self.assertMatches('...Payment ticket created...',
268                           self.browser.contents)
269        self.assertMatches('...Amount Authorized...',
270                           self.browser.contents)
271        payment_id = self.pgapplicant.keys()[0]
272        payment = self.pgapplicant[payment_id]
273        self.assertEqual(payment.p_item,'This is the %s container' % pgft_container_name)
274        self.assertEqual(payment.p_session,session_1)
275        self.assertEqual(payment.p_category,'application')
276        self.assertEqual(payment.amount_auth, 300.0)
277        return
278
279    def test_hide_screening_data(self):
280        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
281        self.browser.open(self.ugapplicant_path + '/manage')
282        self.assertEqual(self.browser.headers['Status'], '200 Ok')
283        self.fill_correct_values()
284        self.browser.getControl(name="form.screening_venue").value = 'Mensa'
285        self.browser.getControl(name="form.screening_date").value = 'Easter'
286        self.browser.getControl(name="form.course1").value = ['CERT1']
287        self.browser.getControl("Save").click()
288        self.assertMatches('...Form has been saved...', self.browser.contents)
289        self.browser.getControl("Save").click()
290        # Venue and date are not shown
291        self.browser.open(self.ugapplicant_path)
292        self.assertFalse('Screening' in self.browser.contents)
293        IWorkflowState(self.ugapplicant).setState('paid')
294        # Venue and date are shown if applicant has paid
295        self.browser.open(self.ugapplicant_path)
296        self.assertTrue('Screening' in self.browser.contents)
297        return
298
299    def test_register_applicant_update(self):
300        # An applicant can register himself.
301        self.ugapplicant.reg_number = u'1234'
302        notify(grok.ObjectModifiedEvent(self.ugapplicant))
303        self.browser.open('http://localhost/app/applicants/%s/' % app_container_name)
304        self.browser.getLink("Register for application").click()
305        # Fill the edit form with suitable values
306        self.browser.getControl(name="form.lastname").value = 'Under'
307        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
308        self.browser.getControl(name="form.reg_number").value = '1234'
309        self.browser.getControl("Send login credentials").click()
310        self.assertMatches('...Your registration was successful...',
311            self.browser.contents)
312        self.assertFalse('...<td>Password:</td>...' in self.browser.contents)
313        # The new applicant can be found in the catalog via the email address
314        cat = getUtility(ICatalog, name='applicants_catalog')
315        results = list(
316            cat.searchResults(email=('xx@yy.zz', 'xx@yy.zz')))
317        applicant = results[0]
318        self.assertEqual(applicant.lastname,'Under')
319        # The applicant can be found in the catalog via the reg_number
320        results = list(
321            cat.searchResults(
322            reg_number=(applicant.reg_number, applicant.reg_number)))
323        self.assertEqual(applicant,results[0])
324        return
325
326    def test_create_ugstudent(self):
327        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
328        manage_path = 'http://localhost/app/applicants/%s/%s/%s' % (
329            app_container_name, self.ugapplicant.application_number, 'manage')
330        self.browser.open(manage_path)
331        self.fill_correct_values()
332        self.browser.getControl("Save").click()
333        IWorkflowState(self.ugapplicant).setState('admitted')
334        self.browser.getControl(name="form.course1").value = ['CERT1']
335        self.browser.getControl(name="form.course_admitted").value = ['CERT1']
336        self.browser.getControl("Save").click()
337        self.browser.getLink("Create student").click()
338        student_id =  self.app['students'].keys()[0]
339        self.assertTrue(('Student %s created' % student_id)
340            in self.browser.contents)
341        student = self.app['students'][student_id]
342        self.assertEqual(student.email, 'xx@yy.zz')
343        self.assertEqual(student.firstname, 'John')
344        self.assertEqual(student.lastname, 'Tester')
345        # Also additional attributes have been copied.
346        self.assertEqual(student.lga, 'foreigner')
347        self.assertEqual(student.nationality, 'NG')
348        return
349
350    def test_applicant_access(self):
351        # Applicants can edit their record
352        self.browser.open(self.login_path)
353        self.browser.getControl(
354            name="form.login").value = self.cbtapplicant.applicant_id
355        self.browser.getControl(name="form.password").value = 'apwd'
356        self.browser.getControl("Login").click()
357        self.assertTrue(
358            'You logged in.' in self.browser.contents)
359        self.browser.getLink("Edit application record").click()
360        self.browser.getControl(name="form.date_of_birth").value = '09/09/1988'
361        self.browser.getControl(name="form.lga").value = ['foreigner']
362        self.browser.getControl(name="form.nationality").value = ['NG']
363        self.browser.getControl(name="form.sex").value = ['m']
364        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
365        self.browser.getControl(name="form.course1").value = ['CERT1']
366        self.browser.getControl("Save").click()
367        #self.assertMatches('...Not exactly 4 items selected...', self.browser.contents)
368        # Since the testbrowser does not support Javascrip we can't test the
369        # save action which clears jamb_subjects_list on the edit form page
370        # An error would be raised.
371
372        # If we login as manager, we can use the manage form page.
373        self.browser.open(self.logout_path)
374        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
375        self.cbtapplicant.jamb_subjects_list = [
376          'english_language', 'fine_art', 'mathematics', 'physics']
377        self.browser.open(self.cbtapplicant_path + '/manage')
378        self.browser.getControl(name="form.date_of_birth").value = '09/09/1988'
379        self.browser.getControl(name="form.lga").value = ['foreigner']
380        self.browser.getControl(name="form.nationality").value = ['NG']
381        self.browser.getControl(name="form.sex").value = ['m']
382        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
383        self.browser.getControl(name="form.course1").value = ['CERT1']
384        self.browser.getControl(name="form.reg_number").value = '1234'
385        self.browser.getControl("Save").click()
386        self.assertMatches('...Form has been saved...', self.browser.contents)
387        # The save action on this form pages, if called with the testbrowser,
388        # replaces jamb_subjects_list by an empty list (and not by None).
389        self.assertEqual(self.cbtapplicant.jamb_subjects_list, [])
390
391class ApplicantExporterTest(ApplicantImportExportSetup):
392
393    layer = FunctionalLayer
394
395    def setUp(self):
396        super(ApplicantExporterTest, self).setUp()
397        self.outfile = os.path.join(self.workdir, 'myoutput.csv')
398        self.cat = getUtility(ICatalog, name='applicants_catalog')
399        self.intids = getUtility(IIntIds)
400        return
401
402    def setup_applicant(self, applicant):
403        # set predictable values for `applicant`
404        applicant.reg_number = u'123456'
405        applicant.applicant_id = u'dp2011_654321'
406        applicant.firstname = u'Anna'
407        applicant.lastname = u'Tester'
408        applicant.middlename = u'M.'
409        applicant.nationality = u'NG'
410        applicant.date_of_birth = datetime.date(1981, 2, 4)
411        applicant.sex = 'f'
412        applicant.email = 'anna@sample.com'
413        applicant.phone = u'+234-123-12345'
414        applicant.course1 = self.certificate
415        applicant.course2 = self.certificate
416        applicant.course_admitted = self.certificate
417        applicant.notice = u'Some notice\nin lines.'
418        applicant.jamb_subjects = u'Line 1\nLine 2'
419        applicant.jamb_subjects_list = ['english_language', 'fine_art']
420        applicant.screening_score = 98
421        applicant.screening_venue = u'Exam Room'
422        applicant.screening_date = u'Saturday, 16th June 2012 2:00:00 PM'
423        applicant.password = 'any password'
424        return applicant
425
426    def test_export_reimport_all(self):
427        # we can export all applicants in a portal
428        # set values we can expect in export file
429        self.applicant = self.setup_applicant(self.applicant)
430        exporter = NigeriaApplicantExporter()
431        exporter.export_all(self.app, self.outfile)
432        result = open(self.outfile, 'rb').read()
433        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,'
437            'emp2_start,emp_end,emp_position,emp_reason,emp_start,employer,'
438            '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,'
441            '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\']",'
454            'Tester,,0,M.,NG,"Some notice\nin lines.",,,'
455            'any password,+234-123-12345#,,,123456,,,,,,,'
456            '"Saturday, 16th June 2012 2:00:00 PM",98,Exam Room,f,,,'
457            'initialized,,0,initialized\r\n')
458        # We can import the same file if we ignore some columns.
459        # Since the applicants_catalog hasn't been notified, the same
460        # record with same reg_number can be imported twice.
461        processor = NigeriaApplicantProcessor()
462        result = processor.doImport(
463            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',
467            'emp2_start','emp_end','emp_position','emp_reason','emp_start','employer',
468            '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',
471            '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'],
480            mode='create')
481        num_succ, num_fail, finished_path, failed_path = result
482        #content = open(failed_path).read()
483        self.assertEqual(num_succ,1)
484        self.assertEqual(num_fail,0)
485        # Now we ignore also the container_code and import the same file
486        # in update mode which means that INigeriaApplicantUpdateByRegNo
487        # is used for field conversion. applicant_id must be ignored
488        # too since the previous import has notified the applicants_catalog
489        # so that the portal 'knows' that reg_number is in use.
490        processor = NigeriaApplicantProcessor()
491        result = processor.doImport(
492            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',
496            'emp2_start','emp_end','emp_position','emp_reason','emp_start','employer',
497            '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',
500            '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'],
509            mode='update')
510        num_succ, num_fail, finished_path, failed_path = result
511        self.assertEqual(num_succ,1)
512        self.assertEqual(num_fail,0)
513        return
Note: See TracBrowser for help on using the repository browser.