From: Jason Kirtland Date: Fri, 29 Jun 2007 18:33:59 +0000 (+0000) Subject: Simplifying that pickle workaround. X-Git-Tag: rel_0_4_6~160 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05e7cf9e2ad5485bce417c6a79dc7f82756fb21d;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Simplifying that pickle workaround. --- diff --git a/test/orm/attributes.py b/test/orm/attributes.py index 70e786bc1d..7cb29fb673 100644 --- a/test/orm/attributes.py +++ b/test/orm/attributes.py @@ -67,13 +67,10 @@ class AttributesTest(PersistTest): o2_mt2_str = [ k for k in o2.__dict__ if k == 'mt2'][0] self.assert_(o_mt2_str == o2_mt2_str) self.assert_(o_mt2_str is not o2_mt2_str) - # take current mt2 from o2 + # change the id of o2.__dict__['mt2'] former = o2.__dict__['mt2'] del o2.__dict__['mt2'] - for k in o.__dict__: - if k == 'mt2': - # set it back with the id-equal key from o, - o2.__dict__[k] = former + o2.__dict__[o_mt2_str] = former pk_o2 = pickle.dumps(o2)