Commit 7d7f84f1 authored by Aurel's avatar Aurel

add a test to proove that local roles are not reindexed after business

template installed new ones


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32750 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4bf9bd74
...@@ -2109,6 +2109,35 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -2109,6 +2109,35 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
self.failUnless(module is not None) self.failUnless(module is not None)
self.assertEquals(module.__ac_local_roles__, new_local_roles) self.assertEquals(module.__ac_local_roles__, new_local_roles)
def stepCheckModuleLocalRolesInCatalogBeforeUpdate(self, sequence=None, sequence_list=None, **kw):
"""
Check presence of local roles
"""
p = self.getPortal()
module_id = sequence.get('module_id')
module = p._getOb(module_id, None)
self.failUnless(module is not None)
sql = "select distinct roles_and_users.uid as uid, allowedRolesAndUsers as role from catalog, roles_and_users where catalog.security_uid = roles_and_users.uid and catalog.uid=%s" %(module.getUid(),)
sql_connection = self.getSQLConnection()
result = sql_connection.manage_test(sql)
result = [(x.uid, x.role) for x in result]
sequence.edit(local_roles_catalog_result=result)
def stepCheckModuleLocalRolesInCatalogAfterUpdate(self, sequence=None, sequence_list=None, **kw):
"""
Check presence of local roles
"""
p = self.getPortal()
module_id = sequence.get('module_id')
before_update_local_roles = sequence.get('local_roles_catalog_result')
module = p._getOb(module_id, None)
self.failUnless(module is not None)
sql = "select distinct roles_and_users.uid as uid, allowedRolesAndUsers as role from catalog, roles_and_users where catalog.security_uid = roles_and_users.uid and catalog.uid=%s" %(module.getUid(),)
sql_connection = self.getSQLConnection()
result = sql_connection.manage_test(sql)
for line in result:
self.assertTrue((line.uid, line.role) not in before_update_local_roles)
def stepCheckLocalRolesRemoved(self, sequence=None, sequence_list=None, **kw): def stepCheckLocalRolesRemoved(self, sequence=None, sequence_list=None, **kw):
""" """
Check non-presence of local roles Check non-presence of local roles
...@@ -3672,10 +3701,13 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -3672,10 +3701,13 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
RemoveLocalRoles \ RemoveLocalRoles \
RemoveBusinessTemplate \ RemoveBusinessTemplate \
RemoveAllTrashBins \ RemoveAllTrashBins \
Tic \
ImportBusinessTemplate \ ImportBusinessTemplate \
UseImportBusinessTemplate \ UseImportBusinessTemplate \
Tic \
CheckBuiltBuildingState \ CheckBuiltBuildingState \
CheckNotInstalledInstallationState \ CheckNotInstalledInstallationState \
CheckModuleLocalRolesInCatalogBeforeUpdate \
InstallBusinessTemplate \ InstallBusinessTemplate \
Tic \ Tic \
CheckInstalledInstallationState \ CheckInstalledInstallationState \
...@@ -3683,6 +3715,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -3683,6 +3715,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
CheckNoTrashBin \ CheckNoTrashBin \
CheckSkinsLayers \ CheckSkinsLayers \
CheckLocalRolesExists \ CheckLocalRolesExists \
CheckModuleLocalRolesInCatalogAfterUpdate \
UninstallBusinessTemplate \ UninstallBusinessTemplate \
CheckBuiltBuildingState \ CheckBuiltBuildingState \
CheckNotInstalledInstallationState \ CheckNotInstalledInstallationState \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment