[Zope] Overriding DateTime
Andreas Jung
lists at zopyx.com
Mon Mar 23 01:25:54 EDT 2009
On Mon, Mar 23, 2009 at 06:21, Tim Knapp <duffyd at kokorice.org> wrote:
> 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?
What is the particular usecase? Zope has a very strong dependency
from DateTime in various places. So there is almost no compatible way for
getting rid of it or for replacing it.
So why?
-aj
P.S. we don't like cross-postings - posting to one list is enough
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20090323/bc18962d/attachment.html
More information about the Zope
mailing list