[Zope3-checkins] CVS: Zope3/src/zope/proxy/context/tests - test_wrapper.py:1.9

Jim Fulton jim@zope.com
Thu, 1 May 2003 17:37:29 -0400


Update of /cvs-repository/Zope3/src/zope/proxy/context/tests
In directory cvs.zope.org:/tmp/cvs-serv17349/zope/proxy/context/tests

Modified Files:
	test_wrapper.py 
Log Message:
Fixed a bug in getting the __class__ attribute from wrappers around
context-aware objects.  We were returning the class of the wrapper
rather than the class of the wrapped objects.


=== Zope3/src/zope/proxy/context/tests/test_wrapper.py 1.8 => 1.9 ===
--- Zope3/src/zope/proxy/context/tests/test_wrapper.py:1.8	Thu May  1 15:35:45 2003
+++ Zope3/src/zope/proxy/context/tests/test_wrapper.py	Thu May  1 17:37:28 2003
@@ -14,7 +14,7 @@
 import pickle
 import unittest
 
-from zope.proxy.context import wrapper, getcontext, getobject
+from zope.proxy.context import wrapper, getcontext, getobject, ContextWrapper
 from zope.proxy.context import ContextMethod, ContextProperty, ContextAware
 from zope.proxy.tests.test_proxy import Thing, ProxyTestCase
 
@@ -158,6 +158,11 @@
         # Nothing special happens; we don't rebind the self of __getattr__
         self.assertEquals(p.getArgs(), (y, 'foo'))
         self.assert_(p.getArgs()[0] is y)
+
+    def test_ContextAware_doesnt_mess_up___class__(self):
+        class C(ContextAware): pass
+        self.assertEqual(ContextWrapper(C(), None).__class__, C)
+
 
     def test_ContextMethod_getattr(self):
         class Z(object):