Back to index

plone3  3.1.7
Public Member Functions
CMFPlone.tests.testQueryCatalog.TestQueryCatalogParseError Class Reference
Inheritance diagram for CMFPlone.tests.testQueryCatalog.TestQueryCatalogParseError:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.tests.testQueryCatalog.TestQueryCatalogParseError:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testSearchableText
def testParseError
def testQueryCatalogParseError
def testQueryCatalogParseError3050
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Detailed Description

Checks that the queryCatalog script returns an empty result set
   in case of ZCTextIndex ParseErrors.

   This testcase uses the real catalog, not a stub.

Definition at line 194 of file testQueryCatalog.py.


Member Function Documentation

Definition at line 201 of file testQueryCatalog.py.

00201 
00202     def afterSetUp(self):
00203         self.folder.invokeFactory('Document', id='doc', text='foo bar baz')

Definition at line 30 of file PloneTestCase.py.

00030 
00031     def getAuthenticator(self):
00032         tag = AuthenticatorView('context', 'request').authenticator()
00033         pattern = '<input .*name="(\w+)".*value="(\w+)"'
00034         return match(pattern, tag).groups()

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.PloneTestCase.PloneTestCase.setRequestMethod (   self,
  method 
) [inherited]
This is a stub now, but in case you want to try
   something fancy on Your Branch (tm), put it here.

Definition at line 26 of file PloneTestCase.py.

00026 
00027     def setRequestMethod(self, method):
00028         self.app.REQUEST.set('REQUEST_METHOD', method)
00029         self.app.REQUEST.method = method

Here is the caller graph for this function:

Definition at line 35 of file PloneTestCase.py.

00035 
00036     def setupAuthenticator(self):
00037         name, token = self.getAuthenticator()
00038         self.app.REQUEST.form[name] = token
00039 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 209 of file testQueryCatalog.py.

00209 
00210     def testParseError(self):
00211         # ZCTextIndex raises ParseError
00212         self.assertRaises(ParseError, self.portal.portal_catalog, 
00213                           SearchableText='-foo')

Definition at line 214 of file testQueryCatalog.py.

00214 
00215     def testQueryCatalogParseError(self):
00216         request = {'SearchableText':'-foo'}
00217         # ZCTextIndex raises ParseError which translates to empty result
00218         expected = []
00219         self.assertEqual(self.portal.queryCatalog(request), expected)

Definition at line 220 of file testQueryCatalog.py.

00220 
00221     def testQueryCatalogParseError3050(self):
00222         # http://dev.plone.org/plone/ticket/3050
00223         request = {'SearchableText':'AND'}
00224         # ZCTextIndex raises ParseError which translates to empty result
00225         expected = []
00226         self.assertEqual(self.portal.queryCatalog(request), expected)
00227 
00228 

Definition at line 204 of file testQueryCatalog.py.

00204 
00205     def testSearchableText(self):
00206         request = {'SearchableText':'foo'}
00207         # We expect a non-empty result set
00208         self.failUnless(self.portal.queryCatalog(request))


The documentation for this class was generated from the following file: