Index: /main/waeup.sirp/trunk/src/waeup/sirp/applicants/jambtables/tests/test_batching.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/applicants/jambtables/tests/test_batching.py	(revision 5741)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/applicants/jambtables/tests/test_batching.py	(revision 5742)
@@ -20,11 +20,30 @@
 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 ##
-"""Unit tests for the applicant importer.
+"""Unit tests for the JAMB data importer.
 """
+
 import grok
+import os
+import shutil
+import tempfile
 import unittest
+from zope.component.hooks import setSite, clearSite
 from zope.interface import verify
 from waeup.sirp.interfaces import IBatchProcessor
 from waeup.sirp.applicants.jambtables import JAMBDataImporter
+
+# Sample data we can use in tests...
+JAMB_SAMPLE_DATA = '''reg_no,fst_sit_fname,lastname,firstname,middlenames,sex,date_of_birth,jamb_state,jamb_lga,course1,screening_date,screening_venue,entry_session,screening_type,ignore_this_col
+91100546DD,ISUOSUO MOSES ODOMERO,ISUOSUO,MOSES,ODOMERO,M,25/5/1982,DEL,ISO-S,BSCPOL,2009/09/25 09:00:00 GMT+1,REPRINT SLIP AS FROM WED 23/09/2009,9,pde,blah
+91111834CC,DURUIHEOMA AUGUSTINA ADANNA,DURUIHEOMA,AUGUSTINA,ADANNA,F,15/4/1986,IMO,MBAIT,BSCPOL,2009/09/25 09:00:00 GMT+1,REPRINT SLIP AS FROM WED 23/09/2009,9,pde,blah
+91109351AC,ARISERE EBIKEBUNA COMFORT,ARISERE,EBIKEBUNA,COMFORT,F,6/1/1984,EDO,OV-SW,BSCPOL,2009/09/25 09:00:00 GMT+1,REPRINT SLIP AS FROM WED 23/09/2009,9,pde,blah
+'''
+
+# The header fields of the above CSV snippet
+HEADER_FIELDS = JAMB_SAMPLE_DATA.split('\n')[0].split(',')
+
+class FakeSite(dict):
+    def getSiteManager(self):
+        return object()
 
 class JAMBDataImporterTest(unittest.TestCase):
@@ -37,8 +56,13 @@
                 }
             )
+        self.workdir = tempfile.mkdtemp()
+        self.csv_file = os.path.join(self.workdir, 'sampledata.csv')
+        open(self.csv_file, 'wb').write(JAMB_SAMPLE_DATA)
         return
 
     def tearDown(self):
-        pass
+        shutil.rmtree(self.workdir)
+        clearSite()
+        return
 
     def test_interface(self):
@@ -75,5 +99,22 @@
         self.importer.delEntry(dict(reg_no='REG_NO_1'), self.site1)
         assert 'REG_NO_1' not in self.site1['jambdata'].keys()
-        
+
+    def test_import(self):
+        # Do a real import
+        # The following modules register important components for import
+        # Registers converters...
+        grok.testing.grok('waeup.sirp.utils.converters')
+        # Registers the Applicant factory...
+        grok.testing.grok('waeup.sirp.applicants.jambtables.applicants')
+
+        # Create a fake site to store datasets in...
+        site = FakeSite()
+        # The site must have a 'jambdata' entry...
+        site['jambdata'] = dict()
+        # Set the fake site as 'current' site object...
+        setSite(site)
+        self.importer.doImport(self.csv_file, HEADER_FIELDS)
+        self.assertTrue(u'91100546DD' in site['jambdata'].keys())
+
 def test_suite():
     suite = unittest.TestSuite()
