Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
PlonePAS.tests.test_migration.MigrationTest Class Reference
Inheritance diagram for PlonePAS.tests.test_migration.MigrationTest:
Inheritance graph
[legend]
Collaboration diagram for PlonePAS.tests.test_migration.MigrationTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def test_migrate_no_user_folder_empty
def test_migrate_memberdata_with_selection_property
def test_migrate_memberdata_with_multiple_selection_property
def test_migrate_groupdata_with_selection_property
def test_migrate_groupdata_with_multiple_selection_property
def test_migrate_no_user_folder_populated_users
def test_migrate_normal_uf_no_group_tools
def test_migrate_populated
def test_migrate_populated_gruf_no_group_tools

Public Attributes

 qi
 checker

Static Public Attributes

 vanilla_plone = True

Detailed Description

Definition at line 184 of file test_migration.py.


Member Function Documentation

Reimplemented from PlonePAS.tests.test_migration.BaseTest.

Definition at line 186 of file test_migration.py.

00186 
00187     def afterSetUp(self):
00188         BaseTest.afterSetUp(self)
00189         self.qi = getToolByName(self.portal, 'portal_quickinstaller')

Definition at line 259 of file test_migration.py.

00259 
00260     def test_migrate_groupdata_with_multiple_selection_property(self):
00261         self.loginAsPortalOwner()
00262         gd = getToolByName(self.portal, 'portal_groupdata')
00263         gd._setProperty('select_choice', ('A', 'B', 'C'), 'lines')
00264         gd._setProperty('choice', 'select_choice', 'multiple selection')
00265         gd._updateProperty('choice', ('A', 'C'))
00266         property = gd.getProperty('select_choice')
00267         self.assertEquals(property, ('A', 'B', 'C'))
00268         property = gd.getProperty('choice')
00269         self.assertEquals(property, ('A', 'C'))
00270         
00271         self.qi.uninstallProducts(['PlonePAS'], reinstall=True)
00272         self.qi.installProduct('PlonePAS', reinstall=True)
00273         
00274         gd = getToolByName(self.portal, 'portal_groupdata')
00275         property = gd.getProperty('select_choice')
00276         self.assertEquals(property, ('A', 'B', 'C'))
00277         property = gd.getProperty('choice')
00278         self.assertEquals(property, ('A', 'C'))

Here is the call graph for this function:

Definition at line 239 of file test_migration.py.

00239 
00240     def test_migrate_groupdata_with_selection_property(self):
00241         self.loginAsPortalOwner()
00242         gd = getToolByName(self.portal, 'portal_groupdata')
00243         gd._setProperty('select_choice', ('A', 'B', 'C'), 'lines')
00244         gd._setProperty('choice', 'select_choice', 'selection')
00245         gd._updateProperty('choice', 'A')
00246         property = gd.getProperty('select_choice')
00247         self.assertEquals(property, ('A', 'B', 'C'))
00248         property = gd.getProperty('choice')
00249         self.assertEquals(property, 'A')
00250         
00251         self.qi.uninstallProducts(['PlonePAS'], reinstall=True)
00252         self.qi.installProduct('PlonePAS', reinstall=True)
00253         
00254         gd = getToolByName(self.portal, 'portal_groupdata')
00255         property = gd.getProperty('select_choice')
00256         self.assertEquals(property, ('A', 'B', 'C'))
00257         property = gd.getProperty('choice')
00258         self.assertEquals(property, 'A')

Here is the call graph for this function:

Definition at line 219 of file test_migration.py.

00219 
00220     def test_migrate_memberdata_with_multiple_selection_property(self):
00221         self.loginAsPortalOwner()
00222         pm = getToolByName(self.portal, 'portal_memberdata')
00223         pm._setProperty('select_choice', ('A', 'B', 'C'), 'lines')
00224         pm._setProperty('choice', 'select_choice', 'multiple selection')
00225         pm._updateProperty('choice', ('A', 'C'))
00226         property = pm.getProperty('select_choice')
00227         self.assertEquals(property, ('A', 'B', 'C'))
00228         property = pm.getProperty('choice')
00229         self.assertEquals(property, ('A', 'C'))
00230         
00231         self.qi.uninstallProducts(['PlonePAS'], reinstall=True)
00232         self.qi.installProduct('PlonePAS', reinstall=True)
00233         
00234         pm = getToolByName(self.portal, 'portal_memberdata')
00235         property = pm.getProperty('select_choice')
00236         self.assertEquals(property, ('A', 'B', 'C'))
00237         property = pm.getProperty('choice')
00238         self.assertEquals(property, ('A', 'C'))

Here is the call graph for this function:

Definition at line 199 of file test_migration.py.

00199 
00200     def test_migrate_memberdata_with_selection_property(self):
00201         self.loginAsPortalOwner()
00202         pm = getToolByName(self.portal, 'portal_memberdata')
00203         pm._setProperty('select_choice', ('A', 'B', 'C'), 'lines')
00204         pm._setProperty('choice', 'select_choice', 'selection')
00205         pm._updateProperty('choice', 'A')
00206         property = pm.getProperty('select_choice')
00207         self.assertEquals(property, ('A', 'B', 'C'))
00208         property = pm.getProperty('choice')
00209         self.assertEquals(property, 'A')
00210         
00211         self.qi.uninstallProducts(['PlonePAS'], reinstall=True)
00212         self.qi.installProduct('PlonePAS', reinstall=True)
00213         
00214         pm = getToolByName(self.portal, 'portal_memberdata')
00215         property = pm.getProperty('select_choice')
00216         self.assertEquals(property, ('A', 'B', 'C'))
00217         property = pm.getProperty('choice')
00218         self.assertEquals(property, 'A')

Here is the call graph for this function:

Definition at line 190 of file test_migration.py.

00190 
00191     def test_migrate_no_user_folder_empty(self):
00192         self.loginAsPortalOwner()
00193         if 'acl_users' in self.portal.objectIds():
00194             self.portal.manage_delObjects(ids=['acl_users'])
00195 
00196         self.qi.uninstallProducts(['PlonePAS'], reinstall=True)
00197         self.qi.installProduct('PlonePAS', reinstall=True)
00198         self.checker.run('checkUserFolder')

Here is the call graph for this function:

Definition at line 279 of file test_migration.py.

00279 
00280     def test_migrate_no_user_folder_populated_users(self):
00281         # XXX This will never work: removing acl_users means loosing all login
00282         # information, so there is nothing useful to (re)create users
00283         self.loginAsPortalOwner()
00284         if 'acl_users' in self.portal.objectIds():
00285             self.portal.manage_delObjects(ids=['acl_users'])
00286 
00287         self.checker.run('populateUsers')
00288         # Don't remove the tools
00289         self.qi.uninstallProducts(['PlonePAS'], reinstall=True)
00290         self.qi.installProduct('PlonePAS', reinstall=True)
00291         self.checker.run('checkUserFolder', 'checkUsers')

Here is the call graph for this function:

Definition at line 292 of file test_migration.py.

00292 
00293     def test_migrate_normal_uf_no_group_tools(self):
00294         self.loginAsPortalOwner()
00295         if 'acl_users' in self.portal.objectIds():
00296             self.portal.manage_delObjects(ids=['acl_users'])
00297         to_remove = ('portal_groups', 'portal_groupdata')
00298         for tname in to_remove:
00299             if tname in self.portal.objectIds():
00300                 self.portal.manage_delObjects(ids=[tname])
00301 
00302         self.checker.run('populateUsers')
00303         self.qi.uninstallProducts(['PlonePAS'], reinstall=True)
00304         self.qi.installProduct('PlonePAS', reinstall=True)
00305         self.checker.run('checkUserFolder', 'checkUsers')

Here is the call graph for this function:

Definition at line 306 of file test_migration.py.

00306 
00307     def test_migrate_populated(self):
00308         self.loginAsPortalOwner()
00309         self.checker.run('populateUsers', 'populateGroups',
00310                          'checkUsers', 'checkGroups')
00311 
00312         self.qi.uninstallProducts(['PlonePAS'], reinstall=True)
00313         self.qi.installProduct('PlonePAS', reinstall=True)
00314         self.checker.run('checkUserFolder', 'checkUsers', 'checkGroups')

Here is the call graph for this function:

Definition at line 315 of file test_migration.py.

00315 
00316     def test_migrate_populated_gruf_no_group_tools(self):
00317         self.loginAsPortalOwner()
00318         self.checker.run('populateUsers', 'populateGroups')
00319         to_remove = ('portal_groups', 'portal_groupdata')
00320         for tname in to_remove:
00321             if tname in self.portal.objectIds():
00322                 self.portal.manage_delObjects(ids=[tname])
00323 
00324         self.qi.uninstallProducts(['PlonePAS'], reinstall=True)
00325         self.qi.installProduct('PlonePAS', reinstall=True)
00326         self.checker.run('checkUserFolder', 'checkUsers')

Here is the call graph for this function:


Member Data Documentation

Definition at line 182 of file test_migration.py.

Definition at line 188 of file test_migration.py.

Definition at line 179 of file test_migration.py.


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