Commit adee3e48 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fix ERP5Site_reindexAll so that it reindexes everything having getUid and also...

fix ERP5Site_reindexAll so that it reindexes everything having getUid and also ERP5 Python Scripts under portal_skins.

and improve test_13_ERP5Site_reindexAll to check if list of paths is exactly same.
parent 6389f185
......@@ -155,45 +155,18 @@ context.portal_simulation.activate(\n
start_tree=start_tree,\n
stop_tree=stop_tree,)\n
\n
# We index templates secondly\n
print "#### Indexing templates ####"\n
# Next we index trash bins\n
print "#### Indexing trash bins ####"\n
# Next we index domains\n
print "#### Indexing domains ####"\n
# Next we index applied rules\n
print "#### Indexing applied rules ####"\n
# Next we index delivery builders\n
print "#### Indexing delivery builders ####"\n
# Next we index order builders\n
print "#### Indexing order builders ####"\n
# Next we index portal types\n
print "#### Indexing portal types ####"\n
# Next we index portal_property_sheets\n
print "#### Indexing portal property sheets ####"\n
# We index tools secondly\n
print "#### Indexing tools ####"\n
\n
folder_tag = \'module\'\n
folder_after_tag = (\'category\', \'person_stage_1\', \'group_person_stage_1\', preference_tag)\n
object_tag = \'document\'\n
object_after_tag = folder_after_tag\n
object_priority = 2 + additional_priority\n
tool_list = [portal.portal_templates, portal.portal_trash,\n
portal.portal_domains, portal.portal_rules,\n
portal.portal_deliveries, portal.portal_orders,\n
portal.portal_caches, portal.portal_types,\n
portal.portal_property_sheets,\n
portal.portal_ids, portal.portal_memcached,]\n
possible_tool_list = [\n
\'portal_contribution_registry\',\n
\'portal_contributions\',\n
\'portal_gadgets\',\n
\'portal_integrations\',\n
\'portal_roundings\',\n
\'portal_solvers\',\n
]\n
for tool_id in possible_tool_list:\n
if getattr(portal, tool_id, None) is not None:\n
tool_list.append(getattr(portal, tool_id))\n
tool_list = [x for x in portal.objectValues() if \\\n
x.uid not in (portal.getUid(), None) and \\\n
x.meta_type != \'ERP5 Folder\' and \\\n
x.id not in (\'portal_alarms\', \'portal_activities\', \'portal_preferences\', \'portal_simulation\', \'portal_uidhandler\')]\n
\n
for folder in tool_list:\n
folder.activate(\n
......@@ -209,6 +182,13 @@ for folder in tool_list:\n
start_tree=start_tree,\n
stop_tree=stop_tree,)\n
\n
# Then we index ERP5 Python Scripts\n
print "#### Indexing ERP5 Python Scripts ####"\n
for path, obj in portal.portal_skins.ZopeFind(portal.portal_skins, obj_metatypes=(\'ERP5 Python Script\',), search_sub=1):\n
obj.activate(tag=folder_tag,\n
priority=object_priority,\n
after_tag=folder_after_tag).immediateReindexObject(sql_catalog_id=sql_catalog_id)\n
\n
# Then we index everything except inventories\n
for folder in portal.objectValues(("ERP5 Folder",)):\n
if folder.getId().find(\'inventory\') < 0:\n
......
41057
\ No newline at end of file
41058
\ No newline at end of file
......@@ -463,6 +463,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
title="GreatTitle2")
# Flush message queue
self.tic()
original_path_list = self.getSQLPathList()
# Clear catalog
portal_catalog = self.getCatalogTool()
portal_catalog.manage_catalogClear()
......@@ -482,10 +483,10 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
result = sql_connection.manage_test(sql)
message_count = result[0]['COUNT(*)']
self.assertEquals(0, message_count)
# Check if object are catalogued
self.checkRelativeUrlInSQLPathList([
organisation.getRelativeUrl(),
'portal_categories/%s' % base_category.getRelativeUrl()])
# Check if all objects are catalogued as before
new_path_list = self.getSQLPathList()
self.assertEquals(set(original_path_list) - set(new_path_list), set())
self.assertEquals(set(new_path_list) - set(original_path_list), set())
def test_14_ReindexWithBrokenCategory(self, quiet=quiet, run=run_all_test):
if not run: return
......
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