Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFCore.tests.test_FSZSQLMethod.FSZSQLMethodCustomizationTests Class Reference
Inheritance diagram for CMFCore.tests.test_FSZSQLMethod.FSZSQLMethodCustomizationTests:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.tests.test_FSZSQLMethod.FSZSQLMethodCustomizationTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def tearDown
def test_customize
def test_customize_alternate_root
def test_customize_fspath_as_dot
def test_customize_manual_clone
def test_customize_properties

Public Attributes

 skins
 custom
 fsdir
 fsZSQL

Detailed Description

Definition at line 45 of file test_FSZSQLMethod.py.


Member Function Documentation

Definition at line 47 of file test_FSZSQLMethod.py.

00047 
00048     def setUp( self ):
00049         FSZSQLMaker.setUp(self)
00050         SecurityTest.setUp( self )
00051 
00052         self.root._setObject( 'portal_skins', Folder( 'portal_skins' ) )
00053         self.skins = self.root.portal_skins
00054 
00055         self.skins._setObject( 'custom', Folder( 'custom' ) )
00056         self.custom = self.skins.custom
00057 
00058         self.skins._setObject( 'fsdir', Folder( 'fsdir' ) )
00059         self.fsdir = self.skins.fsdir
00060 
00061         self.fsdir._setObject( 'testsql'
00062                              , self._makeOne( 'testsql', 'testsql.zsql' ) )
00063 
00064         self.fsZSQL = self.fsdir.testsql

Definition at line 65 of file test_FSZSQLMethod.py.

00065 
00066     def tearDown(self):
00067         SecurityTest.tearDown(self)
00068         FSZSQLMaker.tearDown(self)

Definition at line 69 of file test_FSZSQLMethod.py.

00069 
00070     def test_customize( self ):
00071 
00072         self.fsZSQL.manage_doCustomize( folder_path='custom' )
00073 
00074         self.assertEqual( len( self.custom.objectIds() ), 1 )
00075         self.failUnless( 'testsql' in self.custom.objectIds() )   

Definition at line 76 of file test_FSZSQLMethod.py.

00076 
00077     def test_customize_alternate_root( self ):
00078 
00079         from OFS.Folder import Folder
00080 
00081         self.root.other = Folder('other')
00082 
00083         self.fsZSQL.manage_doCustomize( folder_path='other', root=self.root )
00084 
00085         self.failIf( 'testsql' in self.custom.objectIds() )   
00086         self.failUnless( 'testsql' in self.root.other.objectIds() )   

Definition at line 87 of file test_FSZSQLMethod.py.

00087 
00088     def test_customize_fspath_as_dot( self ):
00089 
00090         self.fsZSQL.manage_doCustomize( folder_path='.' )
00091 
00092         self.failIf( 'testsql' in self.custom.objectIds() )   
00093         self.failUnless( 'testsql' in self.skins.objectIds() )   

Definition at line 94 of file test_FSZSQLMethod.py.

00094 
00095     def test_customize_manual_clone( self ):
00096 
00097         from OFS.Folder import Folder
00098 
00099         clone = Folder('testsql')
00100 
00101         self.fsZSQL.manage_doCustomize( folder_path='custom', obj=clone )
00102 
00103         self.failUnless( 'testsql' in self.custom.objectIds() )   
00104         self.failUnless( aq_base(self.custom._getOb('testsql')) is clone )   

Definition at line 105 of file test_FSZSQLMethod.py.

00105 
00106     def test_customize_properties(self):
00107         # Make sure all properties are coming across
00108         self.fsZSQL.manage_doCustomize( folder_path='custom' )
00109         zsql = self.custom.testsql
00110 
00111         self.assertEqual(zsql.title, 'This is a title')
00112         self.assertEqual(zsql.connection_id, 'testconn')
00113         self.assertEqual(zsql.arguments_src, 'id')
00114         self.assertEqual(zsql.max_rows_, 1000)
00115         self.assertEqual(zsql.max_cache_, 100)
00116         self.assertEqual(zsql.cache_time_, 10)
00117         self.assertEqual(zsql.class_name_, 'MyRecord')
00118         self.assertEqual(zsql.class_file_, 'CMFCore.TestRecord')
00119         self.assertEqual(zsql.connection_hook, 'MyHook')
00120         self.failIf(zsql.allow_simple_one_argument_traversal is None)
00121 


Member Data Documentation

Definition at line 55 of file test_FSZSQLMethod.py.

Definition at line 58 of file test_FSZSQLMethod.py.

Definition at line 63 of file test_FSZSQLMethod.py.

Definition at line 52 of file test_FSZSQLMethod.py.


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