Commit 506fb82c authored by Florent Guillaume's avatar Florent Guillaume

If ZopeLite was imported before these tests were run, they would fail as

they assume the application object it the standard one which includes an
error_log. But run in isolation they would pass.

Now we make sure an error_log is present in the application object.
parent a022f459
...@@ -21,6 +21,10 @@ class SiteErrorLogTests(unittest.TestCase): ...@@ -21,6 +21,10 @@ class SiteErrorLogTests(unittest.TestCase):
def setUp(self): def setUp(self):
transaction.begin() transaction.begin()
self.app = makerequest(Zope2.app()) self.app = makerequest(Zope2.app())
if not hasattr(self.app, 'error_log'):
# If ZopeLite was imported, we have no default error_log
from Products.SiteErrorLog.SiteErrorLog import SiteErrorLog
self.app._setObject('error_log', SiteErrorLog())
try: try:
self.app.manage_addDTMLMethod('doc', '') self.app.manage_addDTMLMethod('doc', '')
except: except:
......
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