[Zope3-checkins] CVS: Zope3/src/zope/app/rdb/tests - test_row.py:1.5

Steve Alexander steve@cat-box.net
Mon, 9 Jun 2003 11:36:10 -0400


Update of /cvs-repository/Zope3/src/zope/app/rdb/tests
In directory cvs.zope.org:/tmp/cvs-serv1546/src/zope/app/rdb/tests

Modified Files:
	test_row.py 
Log Message:
Improve test to better explain what is being tested and why.


=== Zope3/src/zope/app/rdb/tests/test_row.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/rdb/tests/test_row.py:1.4	Mon Jun  9 11:31:57 2003
+++ Zope3/src/zope/app/rdb/tests/test_row.py	Mon Jun  9 11:36:09 2003
@@ -36,6 +36,7 @@
         from zope.app.rdb import RowClassFactory
         from zope.security.proxy import ProxyFactory
         from zope.exceptions import ForbiddenAttribute
+        from zope.security.interfaces import IChecker
 
         columns = ('type', 'speed')
         data = ('airplane', '800km')
@@ -48,10 +49,18 @@
 
         self.failUnless (proxied.type == 'airplane', "security proxy error")
         self.failUnless (proxied.speed == '800km', "security proxy error (2)")
-
         self.assertRaises(ForbiddenAttribute, getattr, proxied, '__slots__')
+
+        # Indirectly, check the the __Security_checker__ attribute has been
+        # applied only to the instance, and not to the class.
+        self.assertRaises(ForbiddenAttribute, getattr, proxied, '__bases__')
         proxied_class = ProxyFactory(klass)
         proxied_class.__bases__
+
+        # Check __Security_checker__ directly
+        self.assertRaises(AttributeError,
+                          getattr, klass, '__Security_checker__')
+        self.assert_(IChecker.isImplementedBy(ob.__Security_checker__))
 
     def test__cmp__(self):
         from zope.app.rdb import RowClassFactory