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

Anthony Baxter anthony at interlink.com.au
Sun Aug 3 02:41:40 EDT 2003


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

Modified Files:
	test_catalog.py 
Log Message:
hooking up keyword indexes to the catalog (even got tests!)


=== Zope3/src/zope/app/catalog/ftests/test_catalog.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/catalog/ftests/test_catalog.py:1.3	Sat Aug  2 13:31:05 2003
+++ Zope3/src/zope/app/catalog/ftests/test_catalog.py	Sun Aug  3 01:41:05 2003
@@ -55,11 +55,22 @@
         self.assertEqual(response.getHeader('Location'),
                  'http://localhost/felix_the/@@contents.html')
 
+        # keyword index 
+        response = self.publish("/felix_the/+/AddKeywordIndexToCatalog=dccreator",
+                        basic='mgr:mgrpw', 
+                        form={'field.interface': 
+                              u'zope.app.interfaces.dublincore.IZopeDublinCore',
+                              'field.field_name':u'Creator', 
+                              'UPDATE_SUBMIT': u'Submit'})
+        self.assertEqual(response.getStatus(), 302)
+        self.assertEqual(response.getHeader('Location'),
+                 'http://localhost/felix_the/@@contents.html')
+
         # Check the indexes are there and visible
         response = self.publish('/felix_the/@@contents.html', basic='mgr:mgrpw')
         self.assertEqual(response.getStatus(), 200)
-        #self.assert_(response.getBody().find('dcdesc') != -1)
         self.assert_(response.getBody().find('dctitle') != -1)
+        self.assert_(response.getBody().find('dccreator') != -1)
         
         # Now add some content
         response = self.publish("/+/action.html", basic='mgr:mgrpw', 
@@ -157,6 +168,8 @@
         self.assert_(len(res)==0)
         res = cat.searchResults(fulltext='sample', dctitle='Zeroth File')
         self.assert_(len(res)==0)
+        res = cat.searchResults(dccreator='mgr', dctitle='Third File')
+        self.assert_(len(res)==3)
 
 def test_suite():
     suite = unittest.TestSuite()




More information about the Zope3-Checkins mailing list