[Zope3-checkins] CVS: Zope3/src/zope/app/catalog/ftests - test_catalog.py:1.5

Anthony Baxter anthony at interlink.com.au
Tue Aug 5 05:33:55 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/catalog/ftests
In directory cvs.zope.org:/tmp/cvs-serv24050/app/catalog/ftests

Modified Files:
	test_catalog.py 
Log Message:
Refactoring of the Catalog<->Index interface to extract common code. 

TextIndexes now index a particular interface+field combination, which 
defaults to ISearchableText/getSearchText. Making a new index hook into
the catalog is now a matter of two or three lines of python and some 
zcml.


=== Zope3/src/zope/app/catalog/ftests/test_catalog.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/catalog/ftests/test_catalog.py:1.4	Sun Aug  3 01:41:05 2003
+++ Zope3/src/zope/app/catalog/ftests/test_catalog.py	Tue Aug  5 04:33:20 2003
@@ -38,12 +38,15 @@
                  'http://localhost/felix_the/@@contents.html')
 
         # and a couple more indexes now - first a full text index
-        response = self.publish("/felix_the/@@contents.html",
+        response = self.publish("/felix_the/+/AddTextIndexToCatalog=fulltext",
                         basic='mgr:mgrpw', 
-                        form={'type_name':
-                                    u'zope.app.index.text.TextCatalogIndex',
-                              'new_value': 'fulltext' })
+                        form={'field.interface':
+                               'zope.app.interfaces.index.text.ISearchableText',
+                              'field.field_name':'getSearchableText',
+                              'UPDATE_SUBMIT': u'Submit'})
         self.assertEqual(response.getStatus(), 302)
+        self.assertEqual(response.getHeader('Location'),
+                 'http://localhost/felix_the/@@contents.html')
 
         # Single page submit
         response = self.publish("/felix_the/+/AddFieldIndexToCatalog=name",




More information about the Zope3-Checkins mailing list