Back to index

plone3  3.1.7
Public Member Functions
Archetypes.tests.test_extensions_utils.InstallIndexesTests Class Reference
Inheritance diagram for Archetypes.tests.test_extensions_utils.InstallIndexesTests:
Inheritance graph
[legend]
Collaboration diagram for Archetypes.tests.test_extensions_utils.InstallIndexesTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def tearDown
def test_base_usage
def test_index_method
def test_bad_index_method

Detailed Description

Definition at line 10 of file test_extensions_utils.py.


Member Function Documentation

Definition at line 12 of file test_extensions_utils.py.

00012 
00013     def tearDown(self):
00014         ATSiteTestCase.tearDown(self)
00015         del ComplexType.schema['richtextfield'].index
00016         try:
00017             del ComplexType.schema['richtextfield'].index_method
00018         except (AttributeError, KeyError):
00019             pass
        

Definition at line 41 of file test_extensions_utils.py.

00041 
00042     def test_bad_index_method(self):
00043         ComplexType.schema['richtextfield'].index = 'TextIndex'
00044         ComplexType.schema['richtextfield'].index_method = lambda x: 'yop'
00045         self.failUnlessRaises(ValueError,
00046                               utils.install_indexes, self.portal, StringIO(), (ComplexType,) )
00047         ComplexType.schema['richtextfield'].index_method = lambda x: 'yop'
00048         self.failUnlessRaises(ValueError,
00049                               utils.install_indexes, self.portal, StringIO(), (ComplexType,) )
00050 
00051         ComplexType.schema['richtextfield'].index_method = ComplexType._get_selection_vocab
00052         self.failUnlessRaises(ValueError,
00053                               utils.install_indexes, self.portal, StringIO(), (ComplexType,) )
00054         

Here is the call graph for this function:

Definition at line 20 of file test_extensions_utils.py.

00020 
00021     def test_base_usage(self):
00022         ComplexType.schema['richtextfield'].index = 'TextIndex'
00023         utils.install_indexes(self.portal, StringIO(), (ComplexType,) )
00024         self.failUnless('getRichtextfield' in self.portal.portal_catalog.indexes())
00025 
        

Here is the call graph for this function:

Definition at line 26 of file test_extensions_utils.py.

00026 
00027     def test_index_method(self):
00028         ComplexType.schema['richtextfield'].index = 'TextIndex'
00029         ComplexType.schema['richtextfield'].index_method = 'Whatever'
00030         utils.install_indexes(self.portal, StringIO(), (ComplexType,) )
00031         self.failUnless('Whatever' in self.portal.portal_catalog.indexes())
00032         
00033         ComplexType.schema['richtextfield'].index_method = '_at_accessor'
00034         utils.install_indexes(self.portal, StringIO(), (ComplexType,) )
00035         self.failUnless('getRichtextfield' in self.portal.portal_catalog.indexes())
00036 
00037         ComplexType.schema['richtextfield'].index_method = '_at_edit_accessor'
00038         utils.install_indexes(self.portal, StringIO(), (ComplexType,) )
00039         self.failUnless('getRawRichtextfield' in self.portal.portal_catalog.indexes())
00040 
        

Here is the call graph for this function:


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