- Timestamp:
- 23 May 2015, 06:54:24 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
r12981 r12996 1064 1064 def test_checkConversion(self): 1065 1065 errs, inv_errs, conv_dict = self.processor.checkConversion( 1066 dict(p_id='<IGNORE>'), mode='create') 1067 self.assertEqual(len(errs),0) 1068 errs, inv_errs, conv_dict = self.processor.checkConversion( 1069 dict(p_id='<IGNORE>'), mode='update') 1070 self.assertEqual(len(errs),1) 1071 self.assertEqual(errs[0], ('p_id', u'missing')) 1072 errs, inv_errs, conv_dict = self.processor.checkConversion( 1066 1073 dict(p_id='3816951266236341955')) 1067 1074 self.assertEqual(len(errs),0) … … 1075 1082 dict(p_id='nonsense')) 1076 1083 self.assertEqual(len(errs),1) 1084 self.assertEqual(errs[0], ('p_id', u'invalid format')) 1077 1085 timestamp = ("%d" % int(time()*10000))[1:] 1078 1086 p_id = "p%s" % timestamp … … 1142 1150 # We perform the same import twice, 1143 1151 # the second time in update mode. The number 1144 # of warnings must be the same.1152 # of warnings increases becaus one p_id is missing. 1145 1153 num, num_warns, fin_file, fail_file = self.processor.doImport( 1146 1154 self.csv_file, PAYMENT_HEADER_FIELDS,'create') … … 1148 1156 num, num_warns, fin_file, fail_file = self.processor.doImport( 1149 1157 self.csv_file, PAYMENT_HEADER_FIELDS,'update') 1150 self.assertEqual(num_warns,0) 1151 shutil.rmtree(os.path.dirname(fin_file)) 1158 self.assertEqual(num_warns,1) 1159 content = open(fail_file).read() 1160 shutil.rmtree(os.path.dirname(fin_file)) 1161 self.assertTrue('p_id: missing' in content) 1152 1162 1153 1163 def test_import_remove(self): 1154 1164 # We perform the same import twice, 1155 1165 # the second time in remove mode. The number 1156 # of warnings must be the same.1166 # of warnings increases becaus one p_id is missing. 1157 1167 num, num_warns, fin_file, fail_file = self.processor.doImport( 1158 1168 self.csv_file, PAYMENT_HEADER_FIELDS,'create') … … 1160 1170 num, num_warns, fin_file, fail_file = self.processor.doImport( 1161 1171 self.csv_file, PAYMENT_HEADER_FIELDS,'remove') 1162 self.assertEqual(num_warns,0) 1172 self.assertEqual(num_warns,1) 1173 content = open(fail_file).read() 1174 self.assertTrue('p_id: missing' in content) 1163 1175 shutil.rmtree(os.path.dirname(fin_file)) 1164 1176 logcontent = open(self.logfile).read() … … 1167 1179 in logcontent) 1168 1180 1169 def test_import_ wo_pid(self):1181 def test_import_same_payment_exists(self): 1170 1182 num, num_warns, fin_file, fail_file = self.processor.doImport( 1171 1183 self.csv_file2, PAYMENT_CREATE_HEADER_FIELDS,'create')
Note: See TracChangeset for help on using the changeset viewer.