[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Forms/tests - testUtility.py:1.7.2.1

Jim Fulton jim@zope.com
Thu, 12 Dec 2002 10:37:50 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/Forms/tests
In directory cvs.zope.org:/tmp/cvs-serv25789/lib/python/Zope/App/Forms/tests

Modified Files:
      Tag: AdapterAndView-branch
	testUtility.py 
Log Message:
Fixed a bug that caused forbidden attribute errors to be masked when
building edit forms.


=== Zope3/lib/python/Zope/App/Forms/tests/testUtility.py 1.7 => 1.7.2.1 ===
--- Zope3/lib/python/Zope/App/Forms/tests/testUtility.py:1.7	Wed Dec 11 08:57:32 2002
+++ Zope3/lib/python/Zope/App/Forms/tests/testUtility.py	Thu Dec 12 10:37:49 2002
@@ -292,6 +292,23 @@
         self.assertEqual(view.title(), u'title: ct')
         self.assertEqual(view.description(), u'description: cd')
 
+    def test_setupEditWidgets_w_bad_data(self):
+        class Forbidden(AttributeError): pass
+        
+        class C(object):
+            title = u'foo'
+
+            def d(self):
+                raise Forbidden()
+            
+            description = property(d)
+
+        c = C()
+
+        request = TestRequest()
+        view = BrowserView(c, request)
+        self.assertRaises(Forbidden, setUpEditWidgets, view, I)
+
     def test_getSetupWidgets_w_form_data(self):
         c = C()
         request = TestRequest()