Commit 489141b9 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

testInvalidationBug: generate transactionless connection string properly.

parent 4d1b48ec
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
# #
############################################################################## ##############################################################################
import re
import threading import threading
import unittest import unittest
import urllib import urllib
...@@ -64,7 +65,9 @@ class TestInvalidationBug(ERP5TypeTestCase): ...@@ -64,7 +65,9 @@ class TestInvalidationBug(ERP5TypeTestCase):
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] connection = self.portal[connection_id]
query = connection.factory()('-' + connection.connection_string).query query = connection.factory()(
re.sub(r'((?:[%*][^ ]+ )*)(![^ ]+ )?(.+)', r'\1-\3', connection.connection_string)
).query
sql = "rollback\0select * from %s where path='%s'" % (table, path) sql = "rollback\0select * from %s where path='%s'" % (table, path)
test_list.append(lambda query=query, sql=sql: len(query(sql)[1])) test_list.append(lambda query=query, sql=sql: len(query(sql)[1]))
result_list = [map(apply, test_list)] result_list = [map(apply, test_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