[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/intid/ - the IntIds view should not enumerate all objects with int IDs (but it's ok

Benji York benji at zope.com
Wed Jun 29 17:48:07 EDT 2005


Log message for revision 30951:
  - the IntIds view should not enumerate all objects with int IDs (but it's ok
          for the tests)
  

Changed:
  U   Zope3/trunk/src/zope/app/intid/browser/__init__.py
  U   Zope3/trunk/src/zope/app/intid/browser/registrations.pt
  U   Zope3/trunk/src/zope/app/intid/browser/tracking.txt
  U   Zope3/trunk/src/zope/app/intid/ftests.py

-=-
Modified: Zope3/trunk/src/zope/app/intid/browser/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/intid/browser/__init__.py	2005-06-29 21:09:55 UTC (rev 30950)
+++ Zope3/trunk/src/zope/app/intid/browser/__init__.py	2005-06-29 21:48:07 UTC (rev 30951)
@@ -30,5 +30,6 @@
         self.context.register(zapi.traverse(self.context, "/++etc++site"))
         self.request.response.redirect('index.html')
 
-    def items(self):  
+    def _items(self):
+        """return all items and their path (for testing only!)"""
         return [(uid, zapi.getPath(ref())) for uid, ref in self.context.items()]

Modified: Zope3/trunk/src/zope/app/intid/browser/registrations.pt
===================================================================
--- Zope3/trunk/src/zope/app/intid/browser/registrations.pt	2005-06-29 21:09:55 UTC (rev 30950)
+++ Zope3/trunk/src/zope/app/intid/browser/registrations.pt	2005-06-29 21:48:07 UTC (rev 30951)
@@ -7,10 +7,11 @@
          tal:replace="view/len" /> objects</p>
 
       <table id="sortable" class="listing" summary="Content listing"
+             tal:condition="request/testing|nothing"
              i18n:attributes="summary">
         <tr><th i18n:translate="">ID</th><th
                 i18n:translate="">Object</th></tr>
-        <tr tal:repeat="row view/items">
+        <tr tal:repeat="row view/_items">
           <td tal:content="python:row[0]" />
           <td><a tal:content="python:row[1]"
                  tal:attributes="href python:row[1]" /></td>

Modified: Zope3/trunk/src/zope/app/intid/browser/tracking.txt
===================================================================
--- Zope3/trunk/src/zope/app/intid/browser/tracking.txt	2005-06-29 21:09:55 UTC (rev 30950)
+++ Zope3/trunk/src/zope/app/intid/browser/tracking.txt	2005-06-29 21:48:07 UTC (rev 30951)
@@ -106,7 +106,7 @@
 the objects we added:
 
   >>> print http(r"""
-  ... GET /++etc++site/default/IntIds/@@index.html HTTP/1.1
+  ... GET /++etc++site/default/IntIds/@@index.html?testing=1 HTTP/1.1
   ... Authorization: Basic mgr:mgrpw
   ... Referer: http://localhost:8081/++etc++site/default/@@contents.html
   ... """)
@@ -133,7 +133,7 @@
 We'll see that reflected in the utility:
 
   >>> print http(r"""
-  ... GET /++etc++site/default/IntIds/@@index.html HTTP/1.1
+  ... GET /++etc++site/default/IntIds/@@index.html?testing=1 HTTP/1.1
   ... Authorization: Basic mgr:mgrpw
   ... Referer: http://localhost:8081/++etc++site/default/@@contents.html
   ... """)
@@ -160,7 +160,7 @@
 all of the objects will go away:
 
   >>> print http(r"""
-  ... GET /++etc++site/default/IntIds/@@index.html HTTP/1.1
+  ... GET /++etc++site/default/IntIds/@@index.html?testing=1 HTTP/1.1
   ... Authorization: Basic mgr:mgrpw
   ... Referer: http://localhost:8081/++etc++site/default/@@contents.html
   ... """)

Modified: Zope3/trunk/src/zope/app/intid/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/intid/ftests.py	2005-06-29 21:09:55 UTC (rev 30950)
+++ Zope3/trunk/src/zope/app/intid/ftests.py	2005-06-29 21:48:07 UTC (rev 30951)
@@ -68,7 +68,8 @@
                                 basic='mgr:mgrpw')
         self.assertEquals(response.getStatus(), 302)
 
-        response = self.publish(self.basepath + '/intid/@@index.html',
+        response = self.publish(self.basepath
+                                + '/intid/@@index.html?testing=1',
                                 basic='mgr:mgrpw')
         self.assertEquals(response.getStatus(), 200)
         body = response.getBody()



More information about the Zope3-Checkins mailing list