Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
CMFCore.tests.test_TypesTool.FTIConstructionTestCase Class Reference
Inheritance diagram for CMFCore.tests.test_TypesTool.FTIConstructionTestCase:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def test_isConstructionAllowed_wo_Container
def test_isConstructionAllowed_wo_ProductFactory
def test_isConstructionAllowed_wo_Security
def test_isConstructionAllowed_for_Omnipotent
def test_isConstructionAllowed_w_Role
def test_isConstructionAllowed_wo_Role
def test_constructInstance_wo_Roles
def test_constructInstance
def test_constructInstance_private
def test_constructInstance_w_args_kw

Private Member Functions

def _getTargetClass
def _makeOne

Detailed Description

Definition at line 390 of file test_TypesTool.py.


Member Function Documentation

Definition at line 392 of file test_TypesTool.py.

00392 
00393     def _getTargetClass(self):
00394         from Products.CMFCore.TypesTool import FactoryTypeInformation
00395 
00396         return FactoryTypeInformation

def CMFCore.tests.test_TypesTool.FTIConstructionTestCase._makeOne (   self,
  args,
  kw 
) [private]

Definition at line 397 of file test_TypesTool.py.

00397 
00398     def _makeOne(self, *args, **kw):
00399         return self._getTargetClass()(*args, **kw)

Here is the call graph for this function:

Definition at line 427 of file test_TypesTool.py.

00427 
00428     def test_constructInstance(self):
00429         self.ti.constructInstance(self.f, 'foo')
00430         foo = self.f._getOb('foo')
00431         self.assertEqual(foo.id, 'foo')

Definition at line 432 of file test_TypesTool.py.

00432 
00433     def test_constructInstance_private(self):
00434         newSecurityManager(None, UserWithRoles('NotAFooAdder').__of__(self.f))
00435         self.ti._constructInstance(self.f, 'foo')
00436         foo = self.f._getOb('foo')
00437         self.assertEqual(foo.id, 'foo')

Definition at line 438 of file test_TypesTool.py.

00438 
00439     def test_constructInstance_w_args_kw(self):
00440         self.ti.constructInstance(self.f, 'bar', 0, 1)
00441         bar = self.f._getOb('bar')
00442         self.assertEqual(bar.id, 'bar')
00443         self.assertEqual(bar._args, (0, 1))
00444 
00445         self.ti.constructInstance(self.f, 'baz', frickle='natz')
00446         baz = self.f._getOb('baz')
00447         self.assertEqual(baz.id, 'baz')
00448         self.assertEqual(baz._kw['frickle'], 'natz')
00449 
00450         self.ti.constructInstance(self.f, 'bam', 0, 1, frickle='natz')
00451         bam = self.f._getOb('bam')
00452         self.assertEqual(bam.id, 'bam')
00453         self.assertEqual(bam._args, (0, 1))
00454         self.assertEqual(bam._kw['frickle'], 'natz')
00455 

Definition at line 422 of file test_TypesTool.py.

00422 
00423     def test_constructInstance_wo_Roles(self):
00424         newSecurityManager(None, UserWithRoles('FooViewer').__of__(self.f))
00425         self.assertRaises(Unauthorized,
00426                           self.ti.constructInstance, self.f, 'foo')

Definition at line 411 of file test_TypesTool.py.

00411 
00412     def test_isConstructionAllowed_for_Omnipotent(self):
00413         newSecurityManager(None, OmnipotentUser().__of__(self.f))
00414         self.failUnless(self.ti.isConstructionAllowed(self.f))

Definition at line 415 of file test_TypesTool.py.

00415 
00416     def test_isConstructionAllowed_w_Role(self):
00417         self.failUnless(self.ti.isConstructionAllowed(self.f))

Definition at line 400 of file test_TypesTool.py.

00400 
00401     def test_isConstructionAllowed_wo_Container(self):
00402         self.failIf(self.ti.isConstructionAllowed(None))

Definition at line 403 of file test_TypesTool.py.

00403 
00404     def test_isConstructionAllowed_wo_ProductFactory(self):
00405         ti = self._makeOne('foo')
00406         self.failIf(ti.isConstructionAllowed(self.f))

Definition at line 418 of file test_TypesTool.py.

00418 
00419     def test_isConstructionAllowed_wo_Role(self):
00420         newSecurityManager(None, UserWithRoles('FooViewer').__of__(self.f))
00421         self.failIf(self.ti.isConstructionAllowed(self.f))

Definition at line 407 of file test_TypesTool.py.

00407 
00408     def test_isConstructionAllowed_wo_Security(self):
00409         noSecurityManager()
00410         self.failIf(self.ti.isConstructionAllowed(self.f))


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