On Fri, Mar 13, 2015 at 5:32 AM, Collin Anderson wrote:
> Hi,
>
> You could try using freezegun to run the test as if it were a certain time
> of day.
> https://pypi.python.org/pypi/freezegun
Hi Collin,
thanks for the response.
After spent some time, finally I managed to
Hi,
You could try using freezegun to run the test as if it were a certain time
of day.
https://pypi.python.org/pypi/freezegun
Or, you could say something like:
if 9 <= datetime.datetime.now().hour < 17:
self.assertContains(response, "It's working time!")
else:
Hello,
I'd like to write a test script for my django app.
Example, if within business hour, my django app will render:
"It's working time!"
And if not within business hour, my django app will render:
"Happy holiday!"
So the views, will check when the url is accessed.
How do I write the test
3 matches
Mail list logo