<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>You need to saved the user object with the color attribute.</div><div>The __setstate__ is just giving you the unsaved one every time.</div>Add 'newuser._p_changed = 1' after the first<div>assert statement below and it will be saved along with</div><div>your change to the Color instance.</div><div><br><div><div>On Jan 17, 2008, at 11:21 AM, Mika, David P (GE, Research) wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 255); font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "> def test_2_setstate(self):<br> print 'in test2'<br> newuser = self.userdb[self.id]<br> # setstate is called subsequently<br> assert hasattr(newuser, 'color')<br> assert newuser.getColor() == 'blue'<br> newuser.setColor('red')<br> assert newuser.getColor() == 'red' </span></blockquote></div><br></div></body></html>