def test_create_event_url(self): context = {} slot = self.period.get_time_slot(datetime.datetime(datetime.datetime.now().year, 1, 4, 7, 0, tzinfo=pytz.utc), datetime.datetime(datetime.datetime.now().year, 1, 4, 7, 12, tzinfo=pytz.utc)) query_string = create_event_url(context, self.cal, slot.start) expected = ('/event/create/MyCalSlug/?year={0}&month=1&day=4&hour=7&minute=0&second=0'.format(datetime.datetime.now().year)) self.assertEqual(query_string['create_event_url'], escape(expected))
def test_create_event_url(self): context = {} slot = self.period.get_time_slot( datetime.datetime(2010, 1, 4, 7, 0, tzinfo=pytz.utc), datetime.datetime(2008, 1, 4, 7, 12, tzinfo=pytz.utc) ) query_string = create_event_url(context, self.cal, slot.start) expected = "/event/create/MyCalSlug/?year=2010&month=1&day=4&hour=7" "&minute=0&second=0" self.assertEqual(query_string["create_event_url"], escape(expected))