From 41ed10334c922e727ae088d2f04de632ddcbbba4 Mon Sep 17 00:00:00 2001
From: Nicolas Dumazet <nicolas.dumazet@nexedi.com>
Date: Fri, 4 Feb 2011 00:45:41 +0000
Subject: [PATCH] And explicitely disallow pickling temporary objects to fix
 TestERP5Type.test_03

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43007 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/mixin/temporary.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/product/ERP5Type/mixin/temporary.py b/product/ERP5Type/mixin/temporary.py
index f51ceae5f9..729ec3251d 100644
--- a/product/ERP5Type/mixin/temporary.py
+++ b/product/ERP5Type/mixin/temporary.py
@@ -26,6 +26,7 @@
 #
 ##############################################################################
 
+from cPickle import PicklingError
 from Acquisition import aq_base
 from Products.ERP5Type.Accessor.Constant import PropertyGetter as \
   PropertyConstantGetter
@@ -38,6 +39,10 @@ class TemporaryDocumentMixin(object):
   isTempDocument = PropertyConstantGetter('isTempDocument', value=True)
   __roles__ = None
 
+  def __getstate__(self):
+    # disallow persistent storage
+    raise PicklingError("Temporary objects can't be pickled")
+
   def reindexObject(self, *args, **kw):
     pass
 
-- 
2.30.9