Changeset 7934 for main/waeup.custom/trunk/src/waeup/custom/students
- Timestamp:
- 21 Mar 2012, 13:50:16 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.