Changeset 6472
- Timestamp:
- 23 Jun 2011, 15:41:51 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_catalog.py
r6470 r6472 32 32 from waeup.sirp.accesscodes.accesscodes import ( 33 33 AccessCode, AccessCodeBatch, invalidate_accesscode, disable_accesscode) 34 from waeup.sirp.accesscodes.workflow import INITIALIZED, USED, DISABLED 34 35 35 36 … … 110 111 # Now we want to find the disabled access code 111 112 cat = queryUtility(ICatalog, name='accesscodes_catalog') 112 results1 = cat.searchResults(state=( 'disabled', 'disabled'))113 results2 = cat.searchResults(state=( 'initialized', 'initialized'))113 results1 = cat.searchResults(state=(DISABLED, DISABLED)) 114 results2 = cat.searchResults(state=(INITIALIZED, INITIALIZED)) 114 115 results1 = [x for x in results1] # Turn results generator into list 115 116 # We found 1 accescode disabled … … 125 126 # Now we want to find the invalidated access code 126 127 cat = queryUtility(ICatalog, name='accesscodes_catalog') 127 results1 = cat.searchResults(state=( 'used', 'used'))128 results2 = cat.searchResults(state=( 'initialized', 'initialized'))128 results1 = cat.searchResults(state=(USED, USED)) 129 results2 = cat.searchResults(state=(INITIALIZED, INITIALIZED)) 129 130 results1 = [x for x in results1] # Turn results generator into list 130 131 # We found 1 accescode used … … 145 146 # exactly one access code. 146 147 results = cat.searchResults(history='Tester', 147 state=( 'used', 'used'),148 state=(USED, USED), 148 149 code=('APP-1-11111111', 'APP-1-22222222')) 149 150 assert len(results) == 1 … … 154 155 # immediately in catalog 155 156 cat = queryUtility(ICatalog, name='accesscodes_catalog') 156 result = cat.searchResults(state=( 'used', 'used'))157 result = cat.searchResults(state=(USED, USED)) 157 158 assert len(result) == 0 158 159 invalidate_accesscode('APP-1-11111111') 159 result = cat.searchResults(state=( 'used', 'used'))160 result = cat.searchResults(state=(USED, USED)) 160 161 assert len(result) == 1
Note: See TracChangeset for help on using the changeset viewer.