def test_export_feed_info_txt_minimal(self): FeedInfo.objects.create( feed=self.feed, publisher_name='PTEST', publisher_url='http://example.com', lang='en') feed_info_txt = FeedInfo.export_txt(self.feed) self.assertEqual(feed_info_txt, """\ feed_publisher_name,feed_publisher_url,feed_lang PTEST,http://example.com,en """)
def test_export_feed_info_txt_minimal(self): FeedInfo.objects.create(feed=self.feed, publisher_name='PTEST', publisher_url='http://example.com', lang='en') feed_info_txt = FeedInfo.export_txt(self.feed) self.assertEqual( feed_info_txt, """\ feed_publisher_name,feed_publisher_url,feed_lang PTEST,http://example.com,en """)
def test_export_feed_info_txt_maximal(self): FeedInfo.objects.create( feed=self.feed, publisher_name='PTEST', publisher_url='http://example.com', lang='en', start_date=date(2012, 9, 2), end_date=date(2013, 1, 1), version='BAR1') feed_info_txt = FeedInfo.export_txt(self.feed) self.assertEqual(feed_info_txt, """\ feed_publisher_name,feed_publisher_url,feed_lang,feed_start_date,\ feed_end_date,feed_version PTEST,http://example.com,en,20120902,20130101,BAR1 """)
def test_export_feed_info_txt_maximal(self): FeedInfo.objects.create(feed=self.feed, publisher_name='PTEST', publisher_url='http://example.com', lang='en', start_date=date(2012, 9, 2), end_date=date(2013, 1, 1), version='BAR1') feed_info_txt = FeedInfo.export_txt(self.feed) self.assertEqual( feed_info_txt, """\ feed_publisher_name,feed_publisher_url,feed_lang,feed_start_date,\ feed_end_date,feed_version PTEST,http://example.com,en,20120902,20130101,BAR1 """)
def test_export_feed_info_txt_empty(self): feed_info_txt = FeedInfo.export_txt(self.feed) self.assertFalse(feed_info_txt)