Commit 25201f8a authored by Jérome Perrin's avatar Jérome Perrin

stop passing immediate_reindex=1 to newContent this API should not exist


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33809 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 89fe9e68
...@@ -2954,8 +2954,7 @@ class TestAccountingWithSequences(ERP5TypeTestCase): ...@@ -2954,8 +2954,7 @@ class TestAccountingWithSequences(ERP5TypeTestCase):
if not cat in path.objectIds(): if not cat in path.objectIds():
path = path.newContent( path = path.newContent(
portal_type='Category', portal_type='Category',
id=cat, id=cat,)
immediate_reindex=1)
else: else:
path = path[cat] path = path[cat]
......
...@@ -170,8 +170,7 @@ class InventoryAPITestCase(ERP5TypeTestCase): ...@@ -170,8 +170,7 @@ class InventoryAPITestCase(ERP5TypeTestCase):
if not cat in path.objectIds() : if not cat in path.objectIds() :
path = path.newContent( path = path.newContent(
portal_type='Category', portal_type='Category',
id=cat, id=cat,)
immediate_reindex=1 )
else: else:
path = path[cat] path = path[cat]
# check categories have been created # check categories have been created
...@@ -179,6 +178,8 @@ class InventoryAPITestCase(ERP5TypeTestCase): ...@@ -179,6 +178,8 @@ class InventoryAPITestCase(ERP5TypeTestCase):
self.assertNotEquals(None, self.assertNotEquals(None,
self.getCategoryTool().restrictedTraverse(cat_string), self.getCategoryTool().restrictedTraverse(cat_string),
cat_string) cat_string)
transaction.commit()
self.tic()
def getNeededCategoryList(self): def getNeededCategoryList(self):
"""return a list of categories that should be created.""" """return a list of categories that should be created."""
...@@ -2319,8 +2320,7 @@ class BaseTestUnitConversion(InventoryAPITestCase): ...@@ -2319,8 +2320,7 @@ class BaseTestUnitConversion(InventoryAPITestCase):
group = unit_module.newContent( group = unit_module.newContent(
id=base, id=base,
portal_type='Quantity Unit Conversion Group', portal_type='Quantity Unit Conversion Group',
quantity_unit="%s/%s" % (base, standard), quantity_unit="%s/%s" % (base, standard),)
immediate_reindex=1 )
if group.getValidationState() in ('draft', 'invalidated'): if group.getValidationState() in ('draft', 'invalidated'):
group.validate() group.validate()
...@@ -2331,8 +2331,7 @@ class BaseTestUnitConversion(InventoryAPITestCase): ...@@ -2331,8 +2331,7 @@ class BaseTestUnitConversion(InventoryAPITestCase):
id=unit, id=unit,
portal_type="Quantity Unit Conversion Definition", portal_type="Quantity Unit Conversion Definition",
quantity_unit="%s/%s" % (base, unit), quantity_unit="%s/%s" % (base, unit),
quantity=amount, quantity=amount,)
immediate_reindex=1)
if definition.getValidationState() in ('draft', 'invalidated'): if definition.getValidationState() in ('draft', 'invalidated'):
definition.validate() definition.validate()
...@@ -2342,12 +2341,12 @@ class BaseTestUnitConversion(InventoryAPITestCase): ...@@ -2342,12 +2341,12 @@ class BaseTestUnitConversion(InventoryAPITestCase):
self.setUpUnitDefinition() self.setUpUnitDefinition()
self._safeTic() self._safeTic()
@reindex
def makeMovement(self, quantity, resource, *variation, **kw): def makeMovement(self, quantity, resource, *variation, **kw):
m = self._makeMovement(quantity=quantity, resource_value=resource, m = self._makeMovement(quantity=quantity, resource_value=resource,
source_value=self.node, destination_value=self.mirror_node, **kw) source_value=self.node, destination_value=self.mirror_node, **kw)
if variation: if variation:
m.setVariationCategoryList(variation) m.setVariationCategoryList(variation)
self._safeTic()
def convertedSimulation(self, metric_type, **kw): def convertedSimulation(self, metric_type, **kw):
return self.getSimulationTool().getInventory( return self.getSimulationTool().getInventory(
...@@ -2500,16 +2499,14 @@ class TestUnitConversionDefinition(BaseTestUnitConversion): ...@@ -2500,16 +2499,14 @@ class TestUnitConversionDefinition(BaseTestUnitConversion):
base_unit = self.resource_bylot_overriding.newContent( base_unit = self.resource_bylot_overriding.newContent(
portal_type='Quantity Unit Conversion Group', portal_type='Quantity Unit Conversion Group',
quantity_unit='unit/unit', quantity_unit='unit/unit',)
immediate_reindex=1)
base_unit.validate() base_unit.validate()
unit = base_unit.newContent( unit = base_unit.newContent(
portal_type='Quantity Unit Conversion Definition', portal_type='Quantity Unit Conversion Definition',
quantity_unit='unit/lot', quantity_unit='unit/lot',
quantity=50, quantity=50,)
immediate_reindex=1)
unit.validate() unit.validate()
self._safeTic() self._safeTic()
......
...@@ -113,8 +113,7 @@ class TestInvoiceVAT(ERP5TypeTestCase): ...@@ -113,8 +113,7 @@ class TestInvoiceVAT(ERP5TypeTestCase):
if not cat in path.objectIds() : if not cat in path.objectIds() :
path = path.newContent( path = path.newContent(
portal_type='Category', portal_type='Category',
id=cat, id=cat,)
immediate_reindex=1 )
else: else:
path = path[cat] path = path[cat]
# check categories have been created # check categories have been created
......
...@@ -84,8 +84,7 @@ class TestPredicateMixIn(ERP5TypeTestCase): ...@@ -84,8 +84,7 @@ class TestPredicateMixIn(ERP5TypeTestCase):
if not cat in path.objectIds() : if not cat in path.objectIds() :
path = path.newContent( path = path.newContent(
portal_type = 'Category', portal_type = 'Category',
id = cat, id = cat,)
immediate_reindex = 1 )
else : else :
path = path[cat] path = path[cat]
...@@ -94,6 +93,8 @@ class TestPredicateMixIn(ERP5TypeTestCase): ...@@ -94,6 +93,8 @@ class TestPredicateMixIn(ERP5TypeTestCase):
self.assertNotEquals(None, self.assertNotEquals(None,
self.getCategoryTool().restrictedTraverse(cat_string), self.getCategoryTool().restrictedTraverse(cat_string),
cat_string) cat_string)
transaction.commit()
self.tic()
def getNeededCategoryList(self): def getNeededCategoryList(self):
"""return a list of categories that should be created.""" """return a list of categories that should be created."""
......
...@@ -195,8 +195,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -195,8 +195,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
self.checkRelativeUrlNotInSQLPathList(path_list) self.checkRelativeUrlNotInSQLPathList(path_list)
# Now we will ask to immediatly reindex # Now we will ask to immediatly reindex
person = person_module.newContent(id='2', person = person_module.newContent(id='2',
portal_type='Person', portal_type='Person',)
immediate_reindex=1) person.immediateReindexObject()
path_list = [person.getRelativeUrl()] path_list = [person.getRelativeUrl()]
self.checkRelativeUrlInSQLPathList(path_list) self.checkRelativeUrlInSQLPathList(path_list)
person.immediateReindexObject() person.immediateReindexObject()
...@@ -228,7 +228,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -228,7 +228,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# Now we will try the same thing as previous test and look at searchFolder # Now we will try the same thing as previous test and look at searchFolder
folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()] folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()]
self.assertEquals([],folder_object_list) self.assertEquals([],folder_object_list)
person = person_module.newContent(id='4',portal_type='Person',immediate_reindex=1) person = person_module.newContent(id='4',portal_type='Person',)
person.immediateReindexObject()
folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()] folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()]
self.assertEquals(['4'],folder_object_list) self.assertEquals(['4'],folder_object_list)
person.immediateReindexObject() person.immediateReindexObject()
...@@ -300,7 +301,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -300,7 +301,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
portal_catalog = self.getCatalogTool() portal_catalog = self.getCatalogTool()
portal_catalog.manage_catalogClear() portal_catalog.manage_catalogClear()
person = person_module.newContent(id='4',portal_type='Person',immediate_reindex=1) person = person_module.newContent(id='4',portal_type='Person')
person.immediateReindexObject()
folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()] folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()]
self.assertEquals(['4'],folder_object_list) self.assertEquals(['4'],folder_object_list)
...@@ -910,8 +912,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -910,8 +912,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
person_module = self.getPersonModule() person_module = self.getPersonModule()
# Now we will ask to immediatly reindex # Now we will ask to immediatly reindex
person = person_module.newContent(id='2', person = person_module.newContent(id='2',
portal_type='Person', portal_type='Person',)
immediate_reindex=1) person.immediateReindexObject()
path_list = [person.getRelativeUrl()] path_list = [person.getRelativeUrl()]
self.checkRelativeUrlInSQLPathList(path_list) self.checkRelativeUrlInSQLPathList(path_list)
# We will delete the connector # We will delete the connector
......
...@@ -206,7 +206,6 @@ class TestIngestion(ERP5TypeTestCase): ...@@ -206,7 +206,6 @@ class TestIngestion(ERP5TypeTestCase):
category_type = 'Category' category_type = 'Category'
base_path_obj.newContent( portal_type = category_type base_path_obj.newContent( portal_type = category_type
, id = category_id , id = category_id
, immediate_reindex = 1
) )
base_path_obj = base_path_obj[category_id] base_path_obj = base_path_obj[category_id]
is_base_category = False is_base_category = False
......
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