Changeset 6932 for main/waeup.sirp
- Timestamp:
- 24 Oct 2011, 05:33:59 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscode.py
r6927 r6932 295 295 """Get next unused num for given prefix. 296 296 """ 297 num = 1 297 # School fee, clearance and hostel application batches start with 0. 298 # These batches are being emptily created during initialization of the 299 # university instance. 300 if prefix in ('CLR', 'SFE', 'HOS'): 301 num = 0 302 else: 303 num = 1 298 304 while self.get('%s-%s' % (prefix, num), None) is not None: 299 305 num += 1 … … 379 385 380 386 def setup(self, site, name, logger): 381 site['accesscodes'] = AccessCodeBatchContainer() 387 basecontainer = AccessCodeBatchContainer() 388 site['accesscodes'] = basecontainer 382 389 logger.info('Installed container for access code batches.') 390 cost = 0.0 391 creator = 'system' 392 entry_num = 0 393 creation_date = datetime.now() 394 basecontainer.createBatch(creation_date, creator, 395 'SFE', cost,entry_num) 396 basecontainer.createBatch(creation_date, creator, 397 'CLR', cost,entry_num) 398 basecontainer.createBatch(creation_date, creator, 399 'HOS', cost,entry_num) 383 400 return 384 401 -
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/browser.txt
r6552 r6932 50 50 For users that have the right to manage access-code related stuff, the 51 51 home page of a `University` instance provides a link to the 52 access-code management screen. In the beginning, there are naturally53 no batches available:52 access-code management screen. In the beginning, there are already 53 three empty batches available which will be filled by online payments: 54 54 55 55 >>> browser.open('http://localhost/myuniversity') … … 61 61 ... 62 62 ... The following batches are available: 63 ...No batches yet... 63 ...CLR... 64 ...HOS... 65 ...SFE... 64 66 ... 65 67 -
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_accesscode.py
r6728 r6932 288 288 assert verifyClass(IAccessCodeBatch, AccessCodeBatch) 289 289 290 def test_container_contents(self): 291 assert 'SFE-0' in self.app['accesscodes'] 292 assert 'HOS-0' in self.app['accesscodes'] 293 assert 'CLR-0' in self.app['accesscodes'] 294 290 295 def test_csv_export(self): 291 296 # Make sure CSV export of accesscodes works -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r6930 r6932 115 115 pin_container.createBatch( 116 116 datetime.now(), 'some_userid', 'PWD', 9.99, 5) 117 pins = pin_container[ pin_container.keys()[0]].values()117 pins = pin_container['PWD-1'].values() 118 118 self.pwdpins = [x.representation for x in pins] 119 119 self.existing_pwdpin = self.pwdpins[0] … … 123 123 pin_container.createBatch( 124 124 datetime.now(), 'some_userid', 'CLR', 9.99, 5) 125 pins = pin_container[ pin_container.keys()[0]].values()125 pins = pin_container['CLR-1'].values() 126 126 pins[0].owner = u'Hans Wurst' 127 127 self.existing_clrac = pins[0]
Note: See TracChangeset for help on using the changeset viewer.