Changeset 12195 for main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Timestamp:
- 11 Dec 2014, 08:21:43 (10 years ago)
- File:
-
- 1 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(
Note: See TracChangeset for help on using the changeset viewer.