Changeset 12195 for main/waeup.ikoba/trunk/src/waeup
- Timestamp:
- 11 Dec 2014, 08:21:43 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_catalog.py
r12194 r12195 177 177 # that the product object attribute of a contract is cleared 178 178 # but the last_product_id is not. 179 self.assertTrue(self.contract.product_object is self.product) 179 180 del self.app['products'][self.product_id] 180 181 self.assertTrue(self.contract.product_object is None) 182 # The document referrer wasn't touched. 183 self.assertTrue(self.contract.document_object is self.document) 181 184 self.assertEqual(self.contract.last_product_id, 'SAM') 185 # We can still find the contract by last_product_id. 182 186 cat = queryUtility(ICatalog, name='contracts_catalog') 183 187 results = cat.searchResults(last_product_id=('SAM', 'SAM')) … … 191 195 logcontent = open(logfile).read() 192 196 self.assertTrue( 193 'INFO - system - ObjectRemovedEvent - K1000000 - c101 - removed: product\n'197 'INFO - system - ObjectRemovedEvent - K1000000 - c101 - removed: SAM\n' 194 198 in logcontent) 195 199 196 200 def test_document_removal(self): 197 # Actually, this test does not test catalog components at all. 198 # Tt only ensures that the document object attributes of a contract 199 # are cleared, like in the test_product_removal above. 201 # This test does not test catalog components at all. 202 # It only ensures that the document object attributes of a contract 203 # are cleared, when a document is removed, much like in the 204 # test_product_removal above. 205 self.assertTrue(self.contract.document_object is self.document) 200 206 del self.customer['documents'][self.document_id] 201 207 self.assertTrue(self.contract.document_object is None) 208 # The product referrer wasn't touched. 209 self.assertTrue(self.contract.product_object is self.product) 202 210 # Document removal is being logged in customers.log 203 211 logfile = os.path.join( -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/product.py
r12194 r12195 82 82 notify(grok.ObjectModifiedEvent(contract)) 83 83 contract.customer.__parent__.logger.info( 84 'ObjectRemovedEvent - %s - %s - removed: product' % ( 85 contract.customer.customer_id, contract.contract_id)) 84 'ObjectRemovedEvent - %s - %s - removed: %s' % ( 85 contract.customer.customer_id, 86 contract.contract_id, 87 prodid)) 86 88 return 87 89
Note: See TracChangeset for help on using the changeset viewer.