[Zope-Checkins] SVN: Zope/branches/philikon-zope32-integration/lib/python/Products/SiteErrorLog/tests/testSiteErrorLog.py If ZopeLite was imported before these tests were run, they would fail as

Florent Guillaume fg at nuxeo.com
Tue Nov 1 16:26:30 EST 2005

Log message for revision 39828:
  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.

  U   Zope/branches/philikon-zope32-integration/lib/python/Products/SiteErrorLog/tests/testSiteErrorLog.py

Modified: Zope/branches/philikon-zope32-integration/lib/python/Products/SiteErrorLog/tests/testSiteErrorLog.py
--- Zope/branches/philikon-zope32-integration/lib/python/Products/SiteErrorLog/tests/testSiteErrorLog.py	2005-11-01 21:23:17 UTC (rev 39827)
+++ Zope/branches/philikon-zope32-integration/lib/python/Products/SiteErrorLog/tests/testSiteErrorLog.py	2005-11-01 21:26:30 UTC (rev 39828)
@@ -21,6 +21,10 @@
     def setUp(self):
         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())
             self.app.manage_addDTMLMethod('doc', '')

More information about the Zope-Checkins mailing list