summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-08-06 16:48:30 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-08-06 16:48:30 +0000
commit63519a4f0472cf2265c0b915e6d153e358a3ebdd (patch)
tree646e64f48fa65650187dc49773a826ece6a60cf1 /test
parent2801ced98605b1084a6db3420ebf1cceb0d83181 (diff)
downloadsqlalchemy-63519a4f0472cf2265c0b915e6d153e358a3ebdd.tar.gz
fixed small pickle bug with lazy loaders [ticket:265]
Diffstat (limited to 'test')
-rw-r--r--test/base/attributes.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/base/attributes.py b/test/base/attributes.py
index 5f555a7e6..233c4458f 100644
--- a/test/base/attributes.py
+++ b/test/base/attributes.py
@@ -6,6 +6,7 @@ import pickle
class MyTest(object):pass
+class MyTest2(object):pass
class AttributesTest(PersistTest):
"""tests for the attributes.py module, which deals with tracking attribute changes on an object."""
@@ -43,7 +44,15 @@ class AttributesTest(PersistTest):
manager.register_attribute(MyTest, 'user_id', uselist = False)
manager.register_attribute(MyTest, 'user_name', uselist = False)
manager.register_attribute(MyTest, 'email_address', uselist = False)
+ manager.register_attribute(MyTest2, 'a', uselist = False)
+ manager.register_attribute(MyTest2, 'b', uselist = False)
+ # shouldnt be pickling callables at the class level
+ def somecallable(*args):
+ return None
+ manager.register_attribute(MyTest, 'mt2', uselist = False, trackparent=True, callable_=somecallable)
x = MyTest()
+ x.mt2 = MyTest2()
+
x.user_id=7
s = pickle.dumps(x)
x2 = pickle.loads(s)