<br><br><div class="gmail_quote">On Mon, Mar 23, 2009 at 06:21, Tim Knapp <span dir="ltr">&lt;<a href="mailto:duffyd@kokorice.org">duffyd@kokorice.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I would like to override the DateTime.DateTime class within my<br>
functional tests. </blockquote><div> I have tried mocking (via mocker) and injecting the<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

subclassed DateTime class into sys.modules (results in a<br>
TraversalError). The fartherest I&#39;ve gotten is to set DateTime.DateTime<br>
= MySubclassedDateTime in my tests.py, which does work for the code<br>
&#39;within&#39; the package(s) I&#39;m testing but all the Zope core code (i.e. the<br>
instance created within PloneTestCase) is still referencing the global<br>
DateTime module. Has anyone successfully done this?</blockquote><div><br>What is the particular usecase? Zope has a very strong dependency<br>from DateTime in various places. So there is almost no compatible way for getting rid of it or for replacing it.<br>
So why?<br><br>-aj <br></div></div><br><br>P.S. we don&#39;t like cross-postings - posting to  one list is enough<br>