def test_change_in_setup_restored(self): # Test Items changing themselve is setup_restored after we've loaded # the item info cache. self.clear_ddb_object_cache() # ensure that Item calls signal_change in setup_restored old_setup_restored = Item.setup_restored def new_setup_restored(self): old_setup_restored(self) self.title = u'new title2' self.signal_change() Item.setup_restored = new_setup_restored try: # Causes the items to be loaded from the db list(Item.feed_view(self.feed.id)) finally: Item.setup_restored = old_setup_restored cached_info = self.get_info_from_item_info_cache(self.items[0].id) self.assertEquals(cached_info.name, 'new title2')