Changeset 6433 for main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests
- Timestamp:
- 20 Jun 2011, 16:54:45 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_catalog.py
r6431 r6433 49 49 self.getRootFolder()['app'] = app 50 50 self.app = self.getRootFolder()['app'] 51 setSite(self.app) 51 52 52 53 # Create batch … … 62 63 self.ac3 = batch.getAccessCode('APP-1-33333333') 63 64 64 setSite(self.app) 65 65 66 return 66 67 … … 74 75 cat = queryUtility(ICatalog, name='accesscodes_catalog') 75 76 assert cat is not None 77 78 def test_search_by_code(self): 79 # We can find a certain code 80 cat = queryUtility(ICatalog, name='accesscodes_catalog') 81 results = cat.searchResults(code=('APP-1-11111111', 'APP-1-11111111')) 82 results = [x for x in results] # Turn results generator into list 83 assert len(results) == 1 84 assert results[0] is self.ac1 85 86 def test_search_code_not_existent(self): 87 # Not existent codes will not be found 88 cat = queryUtility(ICatalog, name='accesscodes_catalog') 89 results = cat.searchResults(code=('APP-1-blah', 'APP-1-blah')) 90 results = [x for x in results] # Turn results generator into list 91 assert len(results) == 0
Note: See TracChangeset for help on using the changeset viewer.