Commit b84c1c64 authored by Jérome Perrin's avatar Jérome Perrin

banking tests: don't fail if movement table is already removed

parent 1682f73a
......@@ -791,21 +791,26 @@ class TestERP5BankingMixin(ERP5TypeTestCase):
sql_connection.manage_test("DROP TABLE IF EXISTS movement")
# Delete also all ZSQL Methods related to movement table
catalog = self.portal.portal_catalog.getSQLCatalog()
catalog.manage_delObjects(ids=["z0_drop_movement",
"z0_uncatalog_movement",
"z_catalog_movement_list",
"z_create_movement",
])
for zsql in ["z0_drop_movement", "z0_uncatalog_movement",
"z_catalog_movement_list", "z_create_movement", ]:
if catalog._getOb(zsql, None) is not None:
catalog.manage_delObjects(ids=[zsql])
# Update properties of catalog
sql_catalog_object_list = list(catalog.sql_catalog_object_list)
sql_uncatalog_object = list(catalog.sql_uncatalog_object)
sql_clear_catalog = list(catalog.sql_clear_catalog)
sql_search_tables = list(catalog.sql_search_tables)
if "z_catalog_movement_list" in sql_catalog_object_list:
sql_catalog_object_list.remove("z_catalog_movement_list")
if "z0_uncatalog_movement" in sql_uncatalog_object:
sql_uncatalog_object.remove("z0_uncatalog_movement")
if "z0_drop_movement" in sql_clear_catalog:
sql_clear_catalog.remove("z0_drop_movement")
if "z_create_movement" in sql_clear_catalog:
sql_clear_catalog.remove("z_create_movement")
if "movement" in sql_search_tables:
sql_search_tables.remove("movement")
catalog.sql_catalog_object_list = tuple(sql_catalog_object_list)
......
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