[ZCM] [ZC] 985/ 4 Reject "import Testing changes attributes
available to Zope.app()"
Collector: Zope Bugs, Features,
and Patches ...
zope-coders-admin at zope.org
Fri Sep 24 20:20:51 EDT 2004
Issue #985 Update (Reject) "import Testing changes attributes available to Zope.app()"
Status Rejected, Zope/bug low
To followup, visit:
http://zope.org/Collectors/Zope/985
==============================================================
= Reject - Entry #4 by chrisw on Sep 24, 2004 8:20 pm
Status: Pending => Rejected
Tres is correct, rejecting as a result.
________________________________________
= Comment - Entry #3 by tseaver on Sep 24, 2004 8:51 am
NOTABUG
*Don't* 'import Testing' unless you are running unit tests,
which are *supposed* to run in isolation from your
production data.
________________________________________
= Comment - Entry #2 by regebro on Sep 24, 2004 5:39 am
You should run Zope.app(), shouldn't you? I don't think this is a bug. If you think it is could you explain more carefulyy why it is a bug?
________________________________________
= Request - Entry #1 by Anonymous User on Jul 24, 2003 5:04 am
Background: Tried to implement a few tests for objects inside Zope. Followed the examples in Zope Developer's Guide, chapter on Testing to add a Request object. The problem (bug?) is that my own folders aren't visible if I import Testing before executing Zope.app().
I.e this code produces errors
def setUp(self):
self.fix_path()
import Zope
from Testing import makerequest
self.app = makerequest.makerequest(Zope.app())
# printout to show error
print self.app.objectIds()
Printout:
['acl_users', 'Control_Panel', 'temp_folder', 'browser_id_manager', 'session_data_manager', 'Examples', 'error_log', 'index_html', 'standard_error_message', 'standard_html_footer', 'standard_html_header', 'standard_template.pt']
=====
while this code (where I run Zope.app() before the import) works.
def setUp(self):
self.fix_path()
import Zope
self.app=Zope.app()
from Testing import makerequest
self.app = makerequest.makerequest(self.app)
print self.app.objectIds()
Printout: (note own folder WSTest at end)
['acl_users', 'Control_Panel', 'standard_html_header', 'standard_html_footer', 'standard_error_message', 'index_html', 'temp_folder', 'browser_id_manager', 'session_data_manager', 'Examples', 'error_log', 'standard_template.pt', 'WSTest']
======
So, the line import Testing seems to change the behaviour of Zope.app(). Took me by surprise for sure.
Hope this is of any use.
==============================================================
More information about the Zope-Collector-Monitor
mailing list