Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Private Member Functions
GenericSetup.tests.test_utils.ObjectManagerHelpersTests Class Reference
Inheritance diagram for GenericSetup.tests.test_utils.ObjectManagerHelpersTests:
Inheritance graph
[legend]
Collaboration diagram for GenericSetup.tests.test_utils.ObjectManagerHelpersTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def test__initObjects

Public Attributes

 helpers

Private Member Functions

def _getTargetClass
def _makeOne

Detailed Description

Definition at line 477 of file test_utils.py.


Member Function Documentation

Definition at line 479 of file test_utils.py.

00479 
00480     def _getTargetClass(self):
00481         from Products.GenericSetup.utils import ObjectManagerHelpers
00482 
00483         return ObjectManagerHelpers

def GenericSetup.tests.test_utils.ObjectManagerHelpersTests._makeOne (   self,
  args,
  kw 
) [private]

Definition at line 484 of file test_utils.py.

00484 
00485     def _makeOne(self, *args, **kw):
00486         from Products.GenericSetup.utils import NodeAdapterBase
00487 
00488         class Foo(self._getTargetClass(), NodeAdapterBase):
00489 
00490             pass
00491 
00492         return Foo(*args, **kw)

Definition at line 493 of file test_utils.py.

00493 
00494     def setUp(self):
00495         from OFS.ObjectManager import ObjectManager
00496 
00497         obj = ObjectManager('obj')
00498         self.helpers = self._makeOne(obj, DummySetupEnviron())

Definition at line 499 of file test_utils.py.

00499 
00500     def test__initObjects(self):
00501         obj = self.helpers.context
00502         self.failIf('history' in obj.objectIds())
00503 
00504         # Add object
00505         node = parseString(_ADD_IMPORT).documentElement
00506         self.helpers._initObjects(node)
00507         self.failUnless('history' in obj.objectIds())
00508 
00509         # Remove it again
00510         node = parseString(_REMOVE_IMPORT).documentElement
00511         self.helpers._initObjects(node)
00512         self.failIf('history' in obj.objectIds())
00513         
00514         # Removing it a second time should not throw an
00515         # AttributeError.
00516         node = parseString(_REMOVE_IMPORT).documentElement
00517         self.helpers._initObjects(node)
00518         self.failIf('history' in obj.objectIds())
00519         


Member Data Documentation

Definition at line 497 of file test_utils.py.


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