You need to saved the user object with the color attribute. The __setstate__ is just giving you the unsaved one every time. Add 'newuser._p_changed = 1' after the first assert statement below and it will be saved along with your change to the Color instance.
On Jan 17, 2008, at 11:21 AM, Mika, David P (GE, Research) wrote:
def test_2_setstate(self): print 'in test2' newuser = self.userdb[self.id] # setstate is called subsequently assert hasattr(newuser, 'color') assert newuser.getColor() == 'blue' newuser.setColor('red') assert newuser.getColor() == 'red'
_______________________________________________ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org http://mail.zope.org/mailman/listinfo/zodb-dev