Changeset 12718 for main/waeup.ikoba/branches/uli-payments/src
- Timestamp:
- 10 Mar 2015, 15:52:18 (10 years ago)
- Location:
- main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/customers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/customers/contracts.py
r12717 r12718 21 21 import grok 22 22 from zope.catalog.interfaces import ICatalog 23 from zope.component import getUtility 23 from zope.component import getUtility, queryUtility 24 24 from zope.component.interfaces import IFactory 25 25 from zope.interface import implementedBy … … 266 266 267 267 def get_payable_by_id(self, contract_id): 268 catalog = getUtility(ICatalog, 'contracts_catalog') 268 catalog = queryUtility(ICatalog, 'contracts_catalog') 269 if catalog is None: 270 return None 269 271 result = catalog.searchResults( 270 272 contract_id=(contract_id, contract_id)) -
main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/customers/tests/test_contract.py
r12717 r12718 181 181 result = finder.get_payable_by_id('Not-a-valid-id') 182 182 self.assertTrue(result is None) 183 184 def test_contract_finder_no_catalog(self): 185 # contract finder does not complain about missing catalog 186 finder = ContractFinder() 187 result = finder.get_payable_by_id('CON1234') 188 self.assertTrue(result is None)
Note: See TracChangeset for help on using the changeset viewer.