From: Mike Bayer Date: Thu, 6 Apr 2006 14:32:57 +0000 (+0000) Subject: added pickle test X-Git-Tag: rel_0_1_6~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca00cd4cc2c46b0788217c39bfb9bf97fe3d86af;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git added pickle test --- diff --git a/test/attributes.py b/test/attributes.py index 446ea56193..4c4c7585c5 100644 --- a/test/attributes.py +++ b/test/attributes.py @@ -2,8 +2,10 @@ from testbase import PersistTest import sqlalchemy.util as util import sqlalchemy.attributes as attributes import unittest, sys, os +import pickle +class MyTest(object):pass class AttributesTest(PersistTest): """tests for the attributes.py module, which deals with tracking attribute changes on an object.""" @@ -36,6 +38,15 @@ class AttributesTest(PersistTest): print repr(u.__dict__) self.assert_(u.user_id == 7 and u.user_name == 'john' and u.email_address == 'lala@123.com') + def testpickleness(self): + manager = attributes.AttributeManager() + manager.register_attribute(MyTest, 'user_id', uselist = False) + manager.register_attribute(MyTest, 'user_name', uselist = False) + manager.register_attribute(MyTest, 'email_address', uselist = False) + x = MyTest() + x.user_id=7 + pickle.dumps(x) + def testlist(self): class User(object):pass class Address(object):pass