Changeset 7934
- Timestamp:
- 21 Mar 2012, 13:50:16 (13 years ago)
- Location:
- main/waeup.custom/trunk/src/waeup/custom
- Files:
-
- 4 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) -
main/waeup.custom/trunk/src/waeup/custom/interswitch/browser.py
r7928 r7934 219 219 220 220 # Add webservice validation 221 validation_list = get_SOAP_response( 222 PRODUCT_ID, self.context.p_id).split(':') 223 # Validation does not make sense yet since the query string 224 # formats are conflicting. 225 print validation_list 221 try: 222 validation_list = get_SOAP_response( 223 PRODUCT_ID, self.context.p_id).split(':') 224 # Validation does not make sense yet since the query string 225 # formats are conflicting. We are only printing the validation string, 226 # nothing else. 227 print validation_list 228 except: 229 print 'Connection to webservice failed.' 226 230 227 231 write_log_message(self,'valid callback: %s' % self.context.p_id) -
main/waeup.custom/trunk/src/waeup/custom/students/tests/test_browser.py
r7928 r7934 35 35 '\n')[0].split(',') 36 36 37 class Student ImporterTest(FunctionalTestCase):37 class StudentProcessorTest(FunctionalTestCase): 38 38 """Perform some batching tests. 39 39 """ … … 42 42 43 43 def setUp(self): 44 super(Student ImporterTest, self).setUp()44 super(StudentProcessorTest, self).setUp() 45 45 # Setup a sample site for each test 46 46 app = University() … … 58 58 setSite(app) 59 59 60 self. importer_base = StudentProcessorBase()61 self. importer = StudentProcessor()60 self.processor_base = StudentProcessorBase() 61 self.processor = StudentProcessor() 62 62 self.workdir = tempfile.mkdtemp() 63 63 self.csv_file = os.path.join(self.workdir, 'sample_student_data.csv') … … 65 65 66 66 def tearDown(self): 67 super(Student ImporterTest, self).tearDown()67 super(StudentProcessorTest, self).tearDown() 68 68 shutil.rmtree(self.workdir) 69 69 shutil.rmtree(self.dc_root) … … 73 73 def test_import(self): 74 74 # We added empty columns 'nationality' and 'lga' to the import file. 75 # The original importer will fail because these fields are required75 # The original processor will fail because these fields are required 76 76 # in the base package. 77 num, num_warns, fin_file, fail_file = self. importer_base.doImport(77 num, num_warns, fin_file, fail_file = self.processor_base.doImport( 78 78 self.csv_file, STUDENT_HEADER_FIELDS) 79 79 self.assertEqual(num_warns,3) 80 80 assert len(self.app['students'].keys()) == 0 81 # The customized importer does not complain since both fields are81 # The customized processor does not complain since both fields are 82 82 # not required in the custom package. 83 num, num_warns, fin_file, fail_file = self. importer.doImport(83 num, num_warns, fin_file, fail_file = self.processor.doImport( 84 84 self.csv_file, STUDENT_HEADER_FIELDS) 85 85 self.assertEqual(num_warns,0)
Note: See TracChangeset for help on using the changeset viewer.