[Checkins] SVN: grok/trunk/src/grok/ftest `index.html` is now the explicit default view name.

Souheil CHELFOUH souheil at chelfouh.com
Tue Jul 6 14:26:45 EDT 2010


Log message for revision 114263:
  `index.html` is now the explicit default view name.
  It was previously set up in zope.app.zcmlfiles that we no longer depend on.
  This fixed the test failure on the Exception view.
  

Changed:
  U   grok/trunk/src/grok/ftesting.zcml
  U   grok/trunk/src/grok/ftests/security/handle_exception.py

-=-
Modified: grok/trunk/src/grok/ftesting.zcml
===================================================================
--- grok/trunk/src/grok/ftesting.zcml	2010-07-06 18:07:22 UTC (rev 114262)
+++ grok/trunk/src/grok/ftesting.zcml	2010-07-06 18:26:45 UTC (rev 114263)
@@ -1,13 +1,15 @@
 <configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:grok="http://namespaces.zope.org/grok"
+   xmlns:browser="http://namespaces.zope.org/browser"
    i18n_domain="grok"
-   package="grok"
-   >
+   package="grok">
 
   <include package="grok" />
   <grok:grok package="grok.ftests" />
 
+  <browser:defaultView name="index.html" />
+
   <securityPolicy
       component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy"
       />

Modified: grok/trunk/src/grok/ftests/security/handle_exception.py
===================================================================
--- grok/trunk/src/grok/ftests/security/handle_exception.py	2010-07-06 18:07:22 UTC (rev 114262)
+++ grok/trunk/src/grok/ftests/security/handle_exception.py	2010-07-06 18:26:45 UTC (rev 114263)
@@ -1,5 +1,4 @@
 """
-
 The handleException() method has a special case that might introduce a proxy
 and cause the grok security to fail, we have a simple test here that assures
 that we don't hit this:
@@ -10,13 +9,12 @@
   Traceback (most recent call last):
   HTTPError: HTTP Error 500: Internal Server Error
   >>> browser.contents
-  "It's gone!"
+  'It is gone!'
 
 """
 
-import zope.interface
-
 import grok
+from zope.interface import Interface
 
 
 class CaveWasRobbedError(Exception):
@@ -24,19 +22,21 @@
 
 
 class Cave(grok.View):
+    """Home of Grok.
+    """
+    grok.context(Interface)
 
-    grok.context(zope.interface.Interface)
+    fire = 'It is gone!'
 
-    fire = "It's gone!"
-
     def render(self):
         raise CaveWasRobbedError("EVERYTHING GONE! GROK ANGRY!")
 
 
 class CaveErrorView(grok.View):
-
+    """Default view for the CaveWasRobbedError.
+    """
+    grok.name("index.html")
     grok.context(CaveWasRobbedError)
-    grok.name("index.html")
 
     def render(self):
         self.request.response.setStatus(500)



More information about the checkins mailing list