anybox.testing.datetime / README.txt

A module to allow playing with time in tests.

This README is also a doctest. To it and other doctests for this package,
simply do::

   nosetests --with-doctest --doctest-extension=txt

Before anything, the package must be imported in order to replace the 
regular ``datetime`` module with the modified one::

   >>> import anybox.testing.datetime
   >>> from datetime import datetime

Let's keep the real value of ``now`` around::

   >>> start =

Then you can::

   >>> datetime.set_now(datetime(2001, 01, 01, 3, 57, 00))
   datetime(2001, 1, 1, 3, 57)

Don't forget afterwards get back to the regular system clock, otherwise
many pieces of code might get very suprised if the system clock looks as if 
it's frozen::

   >>> datetime.real_now()

Now let's check it worked::

   >>> now =
   >>> now > start
   >>> from datetime import timedelta
   >>> now - start < timedelta(0, 0, 10000) # 10 ms