Changeset 6470 for main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests
- Timestamp:
- 23 Jun 2011, 12:31:09 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_accesscodes.py
r6459 r6470 106 106 107 107 def test_invalidate_accesscode(self): 108 assert self.ac1.stat us!= USED108 assert self.ac1.state != USED 109 109 result = invalidate_accesscode('APP-1-11111111') 110 assert self.ac1.stat us== USED110 assert self.ac1.state == USED 111 111 assert result is True 112 112 113 113 def test_disable_accesscode_unused(self): 114 114 # we can disable initialized acs 115 assert self.ac1.stat us!= USED115 assert self.ac1.state != USED 116 116 disable_accesscode('APP-1-11111111') 117 assert self.ac1.stat us== DISABLED117 assert self.ac1.state == DISABLED 118 118 119 119 def test_disable_accesscode_used(self): 120 120 # we can disable already used acs 121 assert self.ac1.stat us!= DISABLED121 assert self.ac1.state != DISABLED 122 122 invalidate_accesscode('APP-1-11111111') 123 123 disable_accesscode('APP-1-11111111') 124 assert self.ac1.stat us== DISABLED124 assert self.ac1.state == DISABLED 125 125 126 126 def test_reenable_accesscode(self): … … 129 129 result = reenable_accesscode('APP-1-11111111') 130 130 assert result is True 131 assert self.ac1.stat us!= USED131 assert self.ac1.state != USED 132 132 133 133 def test_fire_transition(self): -
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_catalog.py
r6452 r6470 110 110 # Now we want to find the disabled access code 111 111 cat = queryUtility(ICatalog, name='accesscodes_catalog') 112 results1 = cat.searchResults(stat us=('disabled', 'disabled'))113 results2 = cat.searchResults(stat us=('initialized', 'initialized'))112 results1 = cat.searchResults(state=('disabled', 'disabled')) 113 results2 = cat.searchResults(state=('initialized', 'initialized')) 114 114 results1 = [x for x in results1] # Turn results generator into list 115 115 # We found 1 accescode disabled … … 125 125 # Now we want to find the invalidated access code 126 126 cat = queryUtility(ICatalog, name='accesscodes_catalog') 127 results1 = cat.searchResults(stat us=('used', 'used'))128 results2 = cat.searchResults(stat us=('initialized', 'initialized'))127 results1 = cat.searchResults(state=('used', 'used')) 128 results2 = cat.searchResults(state=('initialized', 'initialized')) 129 129 results1 = [x for x in results1] # Turn results generator into list 130 130 # We found 1 accescode used … … 145 145 # exactly one access code. 146 146 results = cat.searchResults(history='Tester', 147 stat us=('used', 'used'),147 state=('used', 'used'), 148 148 code=('APP-1-11111111', 'APP-1-22222222')) 149 149 assert len(results) == 1 … … 154 154 # immediately in catalog 155 155 cat = queryUtility(ICatalog, name='accesscodes_catalog') 156 result = cat.searchResults(stat us=('used', 'used'))156 result = cat.searchResults(state=('used', 'used')) 157 157 assert len(result) == 0 158 158 invalidate_accesscode('APP-1-11111111') 159 result = cat.searchResults(stat us=('used', 'used'))159 result = cat.searchResults(state=('used', 'used')) 160 160 assert len(result) == 1
Note: See TracChangeset for help on using the changeset viewer.