From ca00cd4cc2c46b0788217c39bfb9bf97fe3d86af Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 6 Apr 2006 14:32:57 +0000 Subject: [PATCH] added pickle test --- test/attributes.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 -- 2.47.2