def test_enddate(self): """Test the enddate helper function""" req = create_request(query_string={'day': '2012-05-24'}) eq_(enddate(req), datetime(2012, 5, 25)) req = create_request(query_string={'day': 'today'}) eq_(enddate(req), None)
def test_startdate(self): """Test the startdate helper function.""" req = create_request(query_string={'dates': '7d'}) eq_(startdate(req), date.today() - timedelta(days=7)) req = create_request(query_string={'dates': 'today'}) eq_(startdate(req), date.today()) req = create_request(query_string={'day': '2012-05-24'}) eq_(startdate(req), datetime(2012, 5, 24)) req = create_request(query_string={'day': 'today'}) eq_(startdate(req), None) req = create_request() eq_(startdate(req), None)