[Zope] Overriding DateTime
Tim Knapp
duffyd at kokorice.org
Mon Mar 23 01:21:24 EDT 2009
Hi,
I would like to override the DateTime.DateTime class within my
functional tests. I have tried mocking (via mocker) and injecting the
subclassed DateTime class into sys.modules (results in a
TraversalError). The fartherest I've gotten is to set DateTime.DateTime
= MySubclassedDateTime in my tests.py, which does work for the code
'within' the package(s) I'm testing but all the Zope core code (i.e. the
instance created within PloneTestCase) is still referencing the global
DateTime module. Has anyone successfully done this?
Thanks in advance,
Tim
More information about the Zope
mailing list