[Zope3-checkins] CVS: Zope3/lib/python/Zope/ContextWrapper/tests - testSimpleMethodWrapper.py:1.5

Jim Fulton jim@zope.com
Mon, 11 Nov 2002 14:40:43 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/ContextWrapper/tests
In directory cvs.zope.org:/tmp/cvs-serv10777/tests

Modified Files:
	testSimpleMethodWrapper.py 
Log Message:
It's possible to have a property, defined in a class with a name that
is the same as a key in an instance dictionary. This is useful if the
property mediates retrival and update of the stored value.
ContentProperties don't handle this case properly. I fixed the
attribute getting case. The setting case still needs to be fixed.


=== Zope3/lib/python/Zope/ContextWrapper/tests/testSimpleMethodWrapper.py 1.4 => 1.5 ===
--- Zope3/lib/python/Zope/ContextWrapper/tests/testSimpleMethodWrapper.py:1.4	Thu Oct 31 07:52:38 2002
+++ Zope3/lib/python/Zope/ContextWrapper/tests/testSimpleMethodWrapper.py	Mon Nov 11 14:40:43 2002
@@ -203,6 +203,11 @@
         self.assert_(result_obj is self.wrapped)
         self.assert_(result_value is value)
 
+    def testGetContextProperty_w_name_in_dict(self):
+        self.obj.thisIsAContextProperty = False
+        self.assertEqual(self.wrapped.thisIsAContextProperty, True)
+        self.assert_(self.obj.result is self.wrapped)
+
     def testNotFound(self):
         self.assertRaises(AttributeError,
                           getattr, self.wrapped, 'noSuchAttribute')