def testInterfaceProtectedPage(self): xmlconfig( StringIO(template % u''' <browser:page name="test" class="zope.browserpage.tests.test_page.V1" attribute="index" for="zope.browserpage.tests.test_page.IC" permission="zope.Public" allowed_interface="zope.browserpage.tests.test_page.IV" /> ''')) v = component.getMultiAdapter((ob, self.request), name='test') v = ProxyFactory(v) self.assertEqual(v.index(), 'V1 here') self.assertRaises(Exception, getattr, v, 'action')
def testInterfaceProtectedPage(self): xmlconfig(StringIO(template % ''' <browser:page name="test" class="zope.app.component.tests.views.V1" attribute="index" for="zope.app.component.tests.views.IC" permission="zope.Public" allowed_interface="zope.app.component.tests.views.IV" /> ''' )) v = zapi.getMultiAdapter((ob, request), name='test') v = ProxyFactory(v) self.assertEqual(v.index(), 'V1 here') self.assertRaises(Exception, getattr, v, 'action')
def testInterfaceProtectedView(self): xmlconfig.file("xmlrpc.zcml", xmlrpc.tests) v = component.getMultiAdapter((ob, request), name='test2') v = ProxyFactory(v) self.assertEqual(v.index(), 'V1 here') self.assertRaises(Exception, getattr, v, 'action')