Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
GenericSetup.tests.test_rolemap.Test_exportRolemap Class Reference
Inheritance diagram for GenericSetup.tests.test_rolemap.Test_exportRolemap:
Inheritance graph
[legend]
Collaboration diagram for GenericSetup.tests.test_rolemap.Test_exportRolemap:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_unchanged
def test_added_role
def test_acquired_perm
def test_unacquired_perm
def test_unacquired_perm_added_role

Static Public Attributes

 layer = ExportImportZCMLLayer

Detailed Description

Definition at line 364 of file test_rolemap.py.


Member Function Documentation

Definition at line 404 of file test_rolemap.py.

00404 
00405     def test_acquired_perm( self ):
00406 
00407         ACI = 'Access contents information'
00408         ROLES = [ 'Manager', 'Owner' ]
00409 
00410         self.app.site = Folder('site')
00411         site = self.app.site
00412         site.manage_permission( ACI, ROLES, acquire=1 )
00413 
00414         context = DummyExportContext( site )
00415 
00416         from Products.GenericSetup.rolemap import exportRolemap
00417         exportRolemap( context )
00418 
00419         self.assertEqual( len( context._wrote ), 1 )
00420         filename, text, content_type = context._wrote[ 0 ]
00421         self.assertEqual( filename, 'rolemap.xml' )
00422         self._compareDOM( text, _ACQUIRED_EXPORT )
00423         self.assertEqual( content_type, 'text/xml' )

Here is the call graph for this function:

Definition at line 384 of file test_rolemap.py.

00384 
00385     def test_added_role( self ):
00386 
00387         self.app.site = Folder('site')
00388         site = self.app.site
00389         existing_roles = list( getattr( site, '__ac_roles__', [] ) )[:]
00390         existing_roles.append( 'ZZZ' )
00391         site.__ac_roles__ = existing_roles
00392 
00393         context = DummyExportContext( site )
00394 
00395         from Products.GenericSetup.rolemap import exportRolemap
00396         exportRolemap( context )
00397 
00398         self.assertEqual( len( context._wrote ), 1 )
00399         filename, text, content_type = context._wrote[ 0 ]
00400         self.assertEqual( filename, 'rolemap.xml' )
00401         self._compareDOM( text, _ADDED_ROLE_EXPORT )
00402         self.assertEqual( content_type, 'text/xml' )
00403 

Here is the call graph for this function:

Definition at line 424 of file test_rolemap.py.

00424 
00425     def test_unacquired_perm( self ):
00426 
00427         ACI = 'Access contents information'
00428         ROLES = [ 'Manager', 'Owner', 'ZZZ' ]
00429 
00430         self.app.site = Folder('site')
00431         site = self.app.site
00432         existing_roles = list( getattr( site, '__ac_roles__', [] ) )[:]
00433         existing_roles.append( 'ZZZ' )
00434         site.__ac_roles__ = existing_roles
00435         site.manage_permission( ACI, ROLES )
00436 
00437         context = DummyExportContext( site )
00438 
00439         from Products.GenericSetup.rolemap import exportRolemap
00440         exportRolemap( context )
00441 
00442         self.assertEqual( len( context._wrote ), 1 )
00443         filename, text, content_type = context._wrote[ 0 ]
00444         self.assertEqual( filename, 'rolemap.xml' )
00445         self._compareDOM( text, _COMBINED_EXPORT )
00446         self.assertEqual( content_type, 'text/xml' )

Here is the call graph for this function:

Definition at line 447 of file test_rolemap.py.

00447 
00448     def test_unacquired_perm_added_role( self ):
00449 
00450         ACI = 'Access contents information'
00451         ROLES = [ 'Manager', 'Owner' ]
00452 
00453         self.app.site = Folder('site')
00454         site = self.app.site
00455         site.manage_permission( ACI, ROLES )
00456 
00457         context = DummyExportContext( site )
00458 
00459         from Products.GenericSetup.rolemap import exportRolemap
00460         exportRolemap( context )
00461 
00462         self.assertEqual( len( context._wrote ), 1 )
00463         filename, text, content_type = context._wrote[ 0 ]
00464         self.assertEqual( filename, 'rolemap.xml' )
00465         self._compareDOM( text, _UNACQUIRED_EXPORT )
00466         self.assertEqual( content_type, 'text/xml' )
00467 

Here is the call graph for this function:

Definition at line 368 of file test_rolemap.py.

00368 
00369     def test_unchanged( self ):
00370 
00371         self.app.site = Folder('site')
00372         site = self.app.site
00373 
00374         context = DummyExportContext( site )
00375 
00376         from Products.GenericSetup.rolemap import exportRolemap
00377         exportRolemap( context )
00378 
00379         self.assertEqual( len( context._wrote ), 1 )
00380         filename, text, content_type = context._wrote[ 0 ]
00381         self.assertEqual( filename, 'rolemap.xml' )
00382         self._compareDOM( text, _EMPTY_EXPORT )
00383         self.assertEqual( content_type, 'text/xml' )

Here is the call graph for this function:


Member Data Documentation

Definition at line 366 of file test_rolemap.py.


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