Back to index

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

List of all members.

Public Member Functions

def setUp
def tearDown
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

Public Attributes

 f
 ti

Detailed Description

Definition at line 473 of file test_TypesTool.py.


Member Function Documentation

Definition at line 475 of file test_TypesTool.py.

00475 
00476     def setUp(self):
00477         SecurityTest.setUp(self)
00478         sm = getSiteManager()
00479         sm.registerUtility(DummyFactory, IFactory, 'test.dummy')
00480 
00481         self.f = DummyFolder()
00482         self.ti = self._makeOne('Foo', meta_type='Dummy',
00483                                 factory='test.dummy')
00484         newSecurityManager(None, UserWithRoles('FooAdder').__of__(self.f))

Definition at line 485 of file test_TypesTool.py.

00485 
00486     def tearDown(self):
00487         cleanUp()
00488         SecurityTest.tearDown(self)
00489 

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))


Member Data Documentation

Definition at line 480 of file test_TypesTool.py.

Definition at line 481 of file test_TypesTool.py.


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