Commit 38a6e9a5 authored by Jérome Perrin's avatar Jérome Perrin

hack to prevent keeping too many open files in testxhtml

parent 3b1a6511
...@@ -40,6 +40,11 @@ else: ...@@ -40,6 +40,11 @@ else:
from Products.ERP5Type.tests.backportUnittest import \ from Products.ERP5Type.tests.backportUnittest import \
expectedFailure as newSimulationExpectedFailure expectedFailure as newSimulationExpectedFailure
# Keep a global reference to a ZODB storage so that we can import business
# template xml files. XXX this connection will remain open.
db = DB(DemoStorage())
connection = db.open()
class BusinessTemplateInfoBase: class BusinessTemplateInfoBase:
...@@ -103,15 +108,12 @@ class BusinessTemplateInfoBase: ...@@ -103,15 +108,12 @@ class BusinessTemplateInfoBase:
def setUpActions(self): def setUpActions(self):
def parse(file_path): def parse(file_path):
db = DB(DemoStorage()) action_information = importXML(connection, file_path)
_connection = db.open()
action_information = importXML(_connection, file_path)
action_information.__repr__() action_information.__repr__()
for key, value in action_information.__dict__.iteritems(): for key, value in action_information.__dict__.iteritems():
if value not in (None, "") and key in ('action', 'condition') : if value not in (None, "") and key in ('action', 'condition') :
setattr(action_information, key, value.text) setattr(action_information, key, value.text)
actions = action_information.__dict__.copy() actions = action_information.__dict__.copy()
db.close()
return actions return actions
name = '%s/ActionTemplateItem/portal_types/' % self.getPrefix() name = '%s/ActionTemplateItem/portal_types/' % self.getPrefix()
......
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