Re: Testing Django: testing template at different time

2015-03-18 Thread Zaki Akhmad
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

Re: Testing Django: testing template at different time

2015-03-12 Thread Collin Anderson
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:

Testing Django: testing template at different time

2015-03-11 Thread Zaki Akhmad
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