]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
added pickle test
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 6 Apr 2006 14:32:57 +0000 (14:32 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 6 Apr 2006 14:32:57 +0000 (14:32 +0000)
test/attributes.py

index 446ea56193a59cef10109a1abe3cbbd0c929c427..4c4c7585c5381f263f85d76ce5aab2a646d095e4 100644 (file)
@@ -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