def setUp(self): Feed.objects.create(title=feed1['title'], link=feed1['link'], pub_date=to_date(feed1['published'])) Feed.objects.create(title=feed2['title'], link=feed2['link'], pub_date=to_date(feed2['published']))
def test_naive_date(self): with freeze_time("2017-03-09"): self.assertEqual(to_date(feed_naive_date['published']), datetime.datetime.now(tz=None))
def test_expected_date_format_strings(self): self.assertEqual( to_date(feed1['published']), datetime.datetime.strptime( feed1['published'], "%a, %d %b %Y %H:%M:%S %z").replace(tzinfo=None))