Changeset 13607
- Timestamp:
- 13 Jan 2016, 06:34:05 (9 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/university
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/university/batching.py
r13271 r13607 416 416 def addEntry(self, obj, row, site): 417 417 parent = self.getParent(row, site) 418 parent.addCertCourse(row['course'], 419 row['level'], row.get('mandatory',None)) 420 # mandatory is not a required and might be missing 418 # mandatory is not a required and might be missing or can be 419 # the ignore-marker. 420 mandatory = row.get('mandatory', None) 421 if mandatory in (None, IGNORE_MARKER): 422 parent.addCertCourse(row['course'], row['level']) 423 return 424 parent.addCertCourse(row['course'], row['level'], mandatory) 421 425 return 422 426 -
main/waeup.kofa/trunk/src/waeup/kofa/university/tests/sample_certificatecourse_data.csv
r11790 r13607 1 certificate_code,course,department_code,faculty_code,level 2 CRT1,CRS1,DEP1,FAC1,200 3 CRT1,CRS1,DEP1,FAC1,100 4 CRT2,CRS1,DEP1,FAC1,100 1 certificate_code,course,department_code,faculty_code,level,mandatory 2 CRT1,CRS1,DEP1,FAC1,200,1 3 CRT1,CRS1,DEP1,FAC1,300,nonsense 4 CRT1,CRS1,DEP1,FAC1,400,<IGNORE> 5 CRT1,CRS1,DEP1,FAC1,100, 6 CRT2,CRS1,DEP1,FAC1,100, -
main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_batching.py
r13431 r13607 732 732 self.csv_file_certificatecourse, CERTIFICATECOURSE_HEADER_FIELDS) 733 733 content = open(fail_file).read() 734 self.assertEqual(num_warns,2) 734 self.assertEqual(num_warns,2) # the last two 735 735 self.assertEqual( 736 736 content, 737 ' faculty_code,course,level,department_code,certificate_code,'738 ' --ERRORS--\r\nFAC1,CRS1,100,DEP1,CRT1,'739 ' This object already exists.\r\nFAC1,CRS1,100,DEP1,CRT2,'740 ' Not all parents do exist yet.\r\n'741 737 'mandatory,level,faculty_code,course,department_code,' 738 'certificate_code,--ERRORS--\r\n' 739 '<IGNORE>,100,FAC1,CRS1,' 740 'DEP1,CRT1,This object already exists.\r\n' 741 '<IGNORE>,100,FAC1,CRS1,DEP1,CRT2,Not all parents do exist yet.\r\n' 742 742 ) 743 743 logcontent = open(self.logfile).read() … … 746 746 'INFO - system - CertificateCourse Processor - ' 747 747 'sample_certificatecourse_data - CRT1 - updated: ' 748 ' course=CRS1, level=200\n'748 'mandatory=True, level=200, course=CRS1\n' 749 749 in logcontent) 750 751 return 750 return
Note: See TracChangeset for help on using the changeset viewer.