Changeset 8321 for main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/tests
- Timestamp:
- 2 May 2012, 06:24:42 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/tests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/tests/sample_import.csv
r6543 r8321 1 "prefix","serial","ac","state","history" 2 "FOO","9.99","1","0" 3 "FOO","0","FOO-1-11111111","used","2011-06-01 12:12:14 - AC initialized by system||2011-06-01 12:14:14 - comment with ""quotes"" by system" 4 "FOO","1","FOO-1-22222222","initialized","2011-05-30 21:10:12 - AC initialized by system" 5 "FOO","2","FOO-1-33333333","disabled","2012-05-30 21:12:10 - AC initialized by system||2012-05-30 23:10:10 - AC disabled by system" 1 "prefix","serial","ac","state","history","cost" 2 "FOO","9.99","1","0","" 3 "FOO","0","FOO-1-11111111","used","2011-06-01 12:12:14 - AC initialized by system||2011-06-01 12:14:14 - comment with ""quotes"" by system","1000.0" 4 "FOO","1","FOO-1-22222222","initialized","2011-05-30 21:10:12 - AC initialized by system","" 5 "FOO","2","FOO-1-33333333","disabled","2012-05-30 21:12:10 - AC initialized by system||2012-05-30 23:10:10 - AC disabled by system","" -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/tests/test_accesscode.py
r8234 r8321 238 238 239 239 def test_cost(self): 240 # We get the cost set in batch 240 # The cost of an access code will be stored by handle_batch_added 241 # right after the batch has been added to the ZODB. Thus after 242 # creation of the batch, cost is still 0.0 241 243 cost = self.ac1.cost 242 assert cost == 6.6244 assert cost == 0.0 243 245 244 246 class AccessCodeBatchTests(FunctionalTestCase): … … 264 266 265 267 self.ac1 = AccessCode(0, '11111111') 268 self.ac1.cost = 2345.0 266 269 self.ac2 = AccessCode(1, '22222222') 267 270 self.ac3 = AccessCode(2, '33333333') … … 298 301 result_path = os.path.join(batch._getStoragePath(), basename) 299 302 expected = ''' 300 "prefix","serial","ac","state","history" 303 "prefix","serial","ac","state","history","cost" 301 304 "FOO","9.99","1","0" 302 "FOO","0","FOO-1-11111111","used","<YYYY-MM-DD hh:mm:ss> UTC - ..." 303 "FOO","1","FOO-1-22222222","initialized","<YYYY-MM-DD hh:mm:ss> UTC - ..." 304 "FOO","2","FOO-1-33333333","disabled","<YYYY-MM-DD hh:mm:ss> UTC - ..." 305 "FOO","0","FOO-1-11111111","used","<YYYY-MM-DD hh:mm:ss> UTC - ...","2345.0" 306 "FOO","1","FOO-1-22222222","initialized","<YYYY-MM-DD hh:mm:ss> UTC - ...","" 307 "FOO","2","FOO-1-33333333","disabled","<YYYY-MM-DD hh:mm:ss> UTC - ...","" 305 308 '''[1:] 306 309 contents = open(result_path, 'rb').read() … … 366 369 keys, 367 370 [u'FOO-1-11111111', u'FOO-1-22222222', u'FOO-1-33333333']) 371 # Also cost has been stored correctly 372 self.assertEqual(batch['FOO-1-11111111'].cost,1000.0) 368 373 369 374 def test_getAccessCode(self): -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/tests/test_catalog.py
r7811 r8321 60 60 self.ac2 = batch.getAccessCode('APP-1-22222222') 61 61 self.ac3 = batch.getAccessCode('APP-1-33333333') 62 63 64 62 return 65 63
Note: See TracChangeset for help on using the changeset viewer.