wrap connectors in their portal so the .connect() method actually works

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37152 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7f74cb0f
...@@ -54,16 +54,17 @@ class TestInvalidationBug(ERP5TypeTestCase): ...@@ -54,16 +54,17 @@ class TestInvalidationBug(ERP5TypeTestCase):
def testCommitOrder(self): def testCommitOrder(self):
"""Check order of resources being committed""" """Check order of resources being committed"""
module = self.getPortalObject().organisation_module module = self.portal.organisation_module
organisation = module.newContent() # modify ZODB and create activity organisation = module.newContent() # modify ZODB and create activity
organisation.immediateReindexObject() # modify catalog organisation.immediateReindexObject() # modify catalog
path = organisation.getPath() path = organisation.getPath()
test_list = [] test_list = []
for connection_id, table in (('erp5_sql_connection', 'catalog'), for connection_id, table in (('erp5_sql_connection', 'catalog'),
('cmf_activity_sql_connection', 'message')): ('cmf_activity_sql_connection', 'message')):
connection = self.portal[connection_id] conn_class = self.portal[connection_id].__class__
connection = connection.__class__('_' + connection_id, '', conn_string = self.portal[connection_id].connection_string
'-' + connection.connection_string) connection = conn_class('_' + connection_id, '',
'-' + conn_string).__of__(self.portal)
query = "rollback\0select * from %s where path='%s'" % (table, path) query = "rollback\0select * from %s where path='%s'" % (table, path)
test_list.append(lambda manage_test=connection.manage_test, query=query: test_list.append(lambda manage_test=connection.manage_test, query=query:
len(manage_test(query))) len(manage_test(query)))
......
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