From: Jason Kirtland Date: Fri, 29 Jun 2007 18:41:24 +0000 (+0000) Subject: Added another set of assertions for attribute pickling. X-Git-Tag: rel_0_4_6~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e96b3f1c2f86cd044aa857470761a6e0ba6c401e;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Added another set of assertions for attribute pickling. --- diff --git a/test/orm/attributes.py b/test/orm/attributes.py index 7cb29fb673..e63860b8d7 100644 --- a/test/orm/attributes.py +++ b/test/orm/attributes.py @@ -57,6 +57,7 @@ class AttributesTest(PersistTest): o = MyTest() o.mt2.append(MyTest2()) o.user_id=7 + o.mt2[0].a = 'abcde' pk_o = pickle.dumps(o) o2 = pickle.loads(pk_o) @@ -88,7 +89,15 @@ class AttributesTest(PersistTest): pk_o4 = pickle.dumps(o4) self.assert_(pk_o3 == pk_o4) - + + # and lastly make sure we still have our data after all that. + # identical serialzation is great, *if* it's complete :) + self.assert_(o4.user_id == 7) + self.assert_(o4.user_name is None) + self.assert_(o4.email_address is None) + self.assert_(len(o4.mt2) == 1) + self.assert_(o4.mt2[0].a == 'abcde') + self.assert_(o4.mt2[0].b is None) def testlist(self): class User(object):pass