Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
CMFFormController.tests.test_exportimport.Test_importCMFFormController Class Reference
Inheritance diagram for CMFFormController.tests.test_exportimport.Test_importCMFFormController:
Inheritance graph
[legend]
Collaboration diagram for CMFFormController.tests.test_exportimport.Test_importCMFFormController:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_normal
def test_partial
def test_action_not_unicode

Static Public Attributes

string V_OBJECT_ID = 'v_object_id'
string V_CONTEXT_TYPE = 'v_context_type'
string V_BUTTON = 'v_button'
list V_VALIDATORS = ['validator1', 'validator2']
string A_OBJECT_ID = 'a_object_id'
string A_STATUS = 'a_status'
string A_CONTEXT_TYPE = 'a_context_type'
string A_BUTTON = 'a_button'
string A_ACTION_TYPE = 'redirect_to'
string A_ACTION_ARG = 'string:action_arg'

Detailed Description

Definition at line 203 of file test_exportimport.py.


Member Function Documentation

Definition at line 267 of file test_exportimport.py.

00267 
00268     def test_action_not_unicode(self):
00269         # The action arg cannot be unicode for unrestrictedTraverse
00270         # calls to work properly
00271         from Products.CMFFormController.exportimport \
00272              import importCMFFormController
00273 
00274         site = self._initSite(with_info=False)
00275         fc = site.portal_form_controller
00276 
00277         context = DummyImportContext(site)
00278         context._files['cmfformcontroller.xml'] = self._WITH_INFO_EXPORT
00279         importCMFFormController(context)
00280 
00281         action = fc.listFormActions()[0]
00282         self.failUnless(isinstance(action.getActionArg(), str))
00283 

Here is the call graph for this function:

Definition at line 205 of file test_exportimport.py.

00205 
00206     def test_normal(self):
00207         from Products.CMFFormController.exportimport \
00208              import importCMFFormController
00209 
00210         site = self._initSite(with_info=False)
00211         fc = site.portal_form_controller
00212 
00213         self.assertEqual(len(fc.listFormValidators()), 0)
00214         self.assertEqual(len(fc.listFormActions()), 0)
00215 
00216         context = DummyImportContext(site)
00217         context._files['cmfformcontroller.xml'] = self._WITH_INFO_EXPORT
00218         importCMFFormController(context)
00219 
00220         self.assertEqual(len(fc.listFormActions()), 1)
00221         self.assertEqual(len(fc.listFormValidators()), 1)
00222 
00223         action = fc.listFormActions()[0]
00224         self.assertEqual(action.getObjectId(), self.A_OBJECT_ID)
00225         self.assertEqual(action.getStatus(), self.A_STATUS)
00226         self.assertEqual(action.getContextType(), self.A_CONTEXT_TYPE)
00227         self.assertEqual(action.getButton(), self.A_BUTTON)
00228         self.assertEqual(action.getActionType(), self.A_ACTION_TYPE)
00229         self.assertEqual(action.getActionArg(), self.A_ACTION_ARG)
00230 
00231         validator = fc.listFormValidators()[0]
00232         self.assertEqual(validator.getObjectId(), self.V_OBJECT_ID)
00233         self.assertEqual(validator.getContextType(), self.V_CONTEXT_TYPE)
00234         self.assertEqual(validator.getButton(), self.V_BUTTON)
00235         self.assertEqual(validator.getValidators(), self.V_VALIDATORS)

Here is the call graph for this function:

Definition at line 236 of file test_exportimport.py.

00236 
00237     def test_partial(self):
00238         from Products.CMFFormController.exportimport \
00239              import importCMFFormController
00240 
00241         site = self._initSite(with_info=False)
00242         fc = site.portal_form_controller
00243 
00244         self.assertEqual(len(fc.listFormValidators()), 0)
00245         self.assertEqual(len(fc.listFormActions()), 0)
00246 
00247         context = DummyImportContext(site)
00248         context._files['cmfformcontroller.xml'] = self._WITH_PARTIAL_INFO_EXPORT
00249         importCMFFormController(context)
00250 
00251         self.assertEqual(len(fc.listFormActions()), 1)
00252         self.assertEqual(len(fc.listFormValidators()), 1)
00253 
00254         action = fc.listFormActions()[0]
00255         self.assertEqual(action.getObjectId(), self.A_OBJECT_ID)
00256         self.assertEqual(action.getStatus(), self.A_STATUS)
00257         self.assertEqual(action.getContextType(), None)
00258         self.assertEqual(action.getButton(), None)
00259         self.assertEqual(action.getActionType(), self.A_ACTION_TYPE)
00260         self.assertEqual(action.getActionArg(), self.A_ACTION_ARG)
00261 
00262         validator = fc.listFormValidators()[0]
00263         self.assertEqual(validator.getObjectId(), self.V_OBJECT_ID)
00264         self.assertEqual(validator.getContextType(), None)
00265         self.assertEqual(validator.getButton(), None)
00266         self.assertEqual(validator.getValidators(), self.V_VALIDATORS)

Here is the call graph for this function:


Member Data Documentation

Definition at line 35 of file test_exportimport.py.

Definition at line 34 of file test_exportimport.py.

Definition at line 33 of file test_exportimport.py.

Definition at line 32 of file test_exportimport.py.

Definition at line 30 of file test_exportimport.py.

Definition at line 31 of file test_exportimport.py.

Definition at line 27 of file test_exportimport.py.

Definition at line 26 of file test_exportimport.py.

Definition at line 25 of file test_exportimport.py.

list CMFFormController.tests.test_exportimport._CMFFormControllerSetup.V_VALIDATORS = ['validator1', 'validator2'] [static, inherited]

Definition at line 28 of file test_exportimport.py.


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