Changeset 7934 for main/waeup.custom/trunk/src/waeup/custom/applicants
- Timestamp:
- 21 Mar 2012, 13:50:16 (13 years ago)
- Location:
- main/waeup.custom/trunk/src/waeup/custom/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.custom/trunk/src/waeup/custom/applicants/batching.py
r7853 r7934 20 20 21 21 import grok 22 from waeup.kofa.applicants.batching import Applicant Importer22 from waeup.kofa.applicants.batching import ApplicantProcessor 23 23 from waeup.custom.applicants.interfaces import IPGApplicant 24 24 25 class PGApplicant Importer(ApplicantImporter):25 class PGApplicantProcessor(ApplicantProcessor): 26 26 """A batch processor for IPGApplicant objects. 27 27 """ 28 util_name = 'pgapplicant importer'28 util_name = 'pgapplicantprocessor' 29 29 grok.name(util_name) 30 name = u'PG Applicant Importer'30 name = u'PG Applicant Processor' 31 31 iface = IPGApplicant 32 32 factory_name = 'waeup.PGApplicant' -
main/waeup.custom/trunk/src/waeup/custom/applicants/tests.py
r7866 r7934 31 31 from waeup.custom.applicants.container import PGApplicantsContainer 32 32 from waeup.custom.applicants.applicant import PGApplicant 33 from waeup.custom.applicants.batching import PGApplicant Importer33 from waeup.custom.applicants.batching import PGApplicantProcessor 34 34 from waeup.custom.applicants.interfaces import IPGApplicant, IPGApplicantEdit 35 35 … … 40 40 '\n')[0].split(',') 41 41 42 class PGApplicant ImporterTest(FunctionalTestCase):42 class PGApplicantProcessorTest(FunctionalTestCase): 43 43 """Perform some batching tests. 44 44 """ … … 46 46 47 47 def setUp(self): 48 super(PGApplicant ImporterTest, self).setUp()48 super(PGApplicantProcessorTest, self).setUp() 49 49 # Setup a sample site for each test 50 50 app = University() … … 86 86 self.applicant = self.app['applicants']['pg2011'][ 87 87 self.application_number] 88 self. importer = PGApplicantImporter()88 self.processor = PGApplicantProcessor() 89 89 self.workdir = tempfile.mkdtemp() 90 90 self.csv_file = os.path.join(self.workdir, 'sample_applicant_data.csv') … … 92 92 93 93 def tearDown(self): 94 super(PGApplicant ImporterTest, self).tearDown()94 super(PGApplicantProcessorTest, self).tearDown() 95 95 shutil.rmtree(self.workdir) 96 96 shutil.rmtree(self.dc_root) … … 100 100 def test_interfaces(self): 101 101 # Make sure we fulfill the interface contracts. 102 assert verifyObject(IBatchProcessor, self. importer) is True102 assert verifyObject(IBatchProcessor, self.processor) is True 103 103 assert verifyClass( 104 IBatchProcessor, PGApplicant Importer) is True104 IBatchProcessor, PGApplicantProcessor) is True 105 105 assert verifyObject(IPGApplicant, self.applicant) is True 106 106 assert verifyClass( … … 118 118 119 119 def test_import(self): 120 num, num_warns, fin_file, fail_file = self. importer.doImport(120 num, num_warns, fin_file, fail_file = self.processor.doImport( 121 121 self.csv_file, APPLICANT_HEADER_FIELDS) 122 122 self.assertEqual(num_warns,0)
Note: See TracChangeset for help on using the changeset viewer.