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

Jim Fulton jim@zope.com
Thu, 19 Dec 2002 14:51:44 -0500


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

Modified Files:
	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.8 ===
--- 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 19 14:51:43 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()