Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFPlone.tests.testUnicodeSplitter.TestQuery Class Reference
Inheritance diagram for CMFPlone.tests.testUnicodeSplitter.TestQuery:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.tests.testUnicodeSplitter.TestQuery:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testQueryByUmlaut
def testQueryByUmlautLower
def testQueryDifferentiatesUmlauts
def testQueryDifferentiatesUmlautsLower
def testQueryByLatin1
def testQueryByLatin1Lower
def testMixedModeQuery
def testQueryByUnicode
def testQueryByUnicodeLower
def testIndexUnicode
def testIndexUnicodeLower
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 catalog
 doc1
 doc2

Detailed Description

Definition at line 123 of file testUnicodeSplitter.py.


Member Function Documentation

Definition at line 125 of file testUnicodeSplitter.py.

00125 
00126     def afterSetUp(self):
00127         self.catalog = self.portal.portal_catalog
00128         self.folder._setObject('doc1', dummy.Item('doc1'))
00129         self.doc1 = self.folder.doc1
00130         self.folder._setObject('doc2', dummy.Item('doc2'))
00131         self.doc2 = self.folder.doc2

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 217 of file testUnicodeSplitter.py.

00217 
00218     def testIndexUnicode(self):
00219         self.doc1.SearchableText = u'\xc4ffin'
00220         self.catalog.indexObject(self.doc1)
00221         brains = self.catalog(SearchableText='\303\204ffin')
00222         self.assertEqual(len(brains), 1)

Definition at line 223 of file testUnicodeSplitter.py.

00223 
00224     def testIndexUnicodeLower(self):
00225         self.doc1.SearchableText = u'\xc4ffin'
00226         self.catalog.indexObject(self.doc1)
00227         brains = self.catalog(SearchableText='\303\244ffin')
00228         self.assertEqual(len(brains), 1)
00229 

Definition at line 188 of file testUnicodeSplitter.py.

00188 
00189     def testMixedModeQuery(self):
00190         #
00191         # Test passes because plone_lexicon pipeline elements
00192         # are coded defensively.
00193         #
00194         saved = _setlocale(*LATIN1)
00195         try:
00196             # Index Latin-1
00197             self.doc1.SearchableText = '\xc4ffin'
00198             self.catalog.indexObject(self.doc1)
00199             # Query by UTF-8
00200             brains = self.catalog(SearchableText='\303\204ffin')
00201             # We get no results, but at least we don't break
00202             self.assertEqual(len(brains), 0)
00203         finally:
00204             _setlocale(saved)

Here is the call graph for this function:

Definition at line 160 of file testUnicodeSplitter.py.

00160 
00161     def testQueryByLatin1(self):
00162         #
00163         # Test passes because plone_lexicon pipeline elements
00164         # are coded defensively.
00165         #
00166         saved = _setlocale(*LATIN1)
00167         try:
00168             self.doc1.SearchableText = '\xc4ffin'
00169             self.catalog.indexObject(self.doc1)
00170             brains = self.catalog(SearchableText='\xc4ffin')
00171             self.assertEqual(len(brains), 1)
00172         finally:
00173             _setlocale(saved)

Here is the call graph for this function:

Definition at line 174 of file testUnicodeSplitter.py.

00174 
00175     def testQueryByLatin1Lower(self):
00176         #
00177         # Test passes because plone_lexicon pipeline elements
00178         # are coded defensively.
00179         #
00180         saved = _setlocale(*LATIN1)
00181         try:
00182             self.doc1.SearchableText = '\xc4ffin'
00183             self.catalog.indexObject(self.doc1)
00184             brains = self.catalog(SearchableText='\xe4ffin')
00185             self.assertEqual(len(brains), 1)
00186         finally:
00187             _setlocale(saved)

Here is the call graph for this function:

Definition at line 132 of file testUnicodeSplitter.py.

00132 
00133     def testQueryByUmlaut(self):
00134         self.doc1.SearchableText = '\303\204ffin'
00135         self.catalog.indexObject(self.doc1)
00136         brains = self.catalog(SearchableText='\303\204ffin')
00137         self.assertEqual(len(brains), 1)

Definition at line 138 of file testUnicodeSplitter.py.

00138 
00139     def testQueryByUmlautLower(self):
00140         self.doc1.SearchableText = '\303\204ffin'
00141         self.catalog.indexObject(self.doc1)
00142         brains = self.catalog(SearchableText='\303\244ffin')
00143         self.assertEqual(len(brains), 1)

Definition at line 205 of file testUnicodeSplitter.py.

00205 
00206     def testQueryByUnicode(self):
00207         self.doc1.SearchableText = '\303\204ffin'
00208         self.catalog.indexObject(self.doc1)
00209         brains = self.catalog(SearchableText=u'\xc4ffin')
00210         self.assertEqual(len(brains), 1)

Definition at line 211 of file testUnicodeSplitter.py.

00211 
00212     def testQueryByUnicodeLower(self):
00213         self.doc1.SearchableText = '\303\204ffin'
00214         self.catalog.indexObject(self.doc1)
00215         brains = self.catalog(SearchableText=u'\xe4ffin')
00216         self.assertEqual(len(brains), 1)

Definition at line 144 of file testUnicodeSplitter.py.

00144 
00145     def testQueryDifferentiatesUmlauts(self):
00146         self.doc1.SearchableText = '\303\204ffin'
00147         self.catalog.indexObject(self.doc1)
00148         self.doc2.SearchableText = '\303\226ffin'
00149         self.catalog.indexObject(self.doc2)
00150         brains = self.catalog(SearchableText='\303\226ffin')
00151         self.assertEqual(len(brains), 1)

Definition at line 152 of file testUnicodeSplitter.py.

00152 
00153     def testQueryDifferentiatesUmlautsLower(self):
00154         self.doc1.SearchableText = '\303\204ffin'
00155         self.catalog.indexObject(self.doc1)
00156         self.doc2.SearchableText = '\303\226ffin'
00157         self.catalog.indexObject(self.doc2)
00158         brains = self.catalog(SearchableText='\303\266ffin')
00159         self.assertEqual(len(brains), 1)


Member Data Documentation

Definition at line 126 of file testUnicodeSplitter.py.

Definition at line 128 of file testUnicodeSplitter.py.

Definition at line 130 of file testUnicodeSplitter.py.


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