Esempio n. 1
0
 def test_feed_entry(self):
     entry = self.create_published_entry()
     feed = EntryFeed()
     self.assertEquals(feed.item_pubdate(entry), entry.creation_date)
     self.assertEquals(feed.item_categories(entry), [self.category.title])
     self.assertEquals(feed.item_author_name(entry), self.author.username)
     self.assertEquals(feed.item_author_email(entry), self.author.email)
     self.assertEquals(feed.item_author_link(entry),
                       'http://example.com/authors/%s/' % self.author.username)
     self.assertEquals(feed.item_enclosure_url(entry), 'http://example.com/image.jpg')
     self.assertEquals(feed.item_enclosure_length(entry), '100000')
     self.assertEquals(feed.item_enclosure_mime_type(entry), 'image/jpeg')
Esempio n. 2
0
 def test_entry_feed(self):
     entry = self.create_published_entry()
     feed = EntryFeed()
     self.assertEqual(feed.item_pubdate(entry), entry.creation_date)
     self.assertEqual(feed.item_categories(entry), [self.category.title])
     self.assertEqual(feed.item_author_name(entry), six.text_type(self.author))
     self.assertEqual(feed.item_author_email(entry), self.author.email)
     self.assertEqual(feed.item_author_link(entry), "http://example.com/authors/%s/" % self.author.username)
     # Test a NoReverseMatch for item_author_link
     self.author.username = "******"
     self.author.save()
     feed.item_author_name(entry)
     self.assertEqual(feed.item_author_link(entry), "http://example.com")
Esempio n. 3
0
 def test_feed_entry(self):
     entry = self.create_published_entry()
     feed = EntryFeed()
     self.assertEquals(feed.item_pubdate(entry), entry.creation_date)
     self.assertEquals(feed.item_categories(entry), [self.category.title])
     self.assertEquals(feed.item_author_name(entry), self.author.username)
     self.assertEquals(feed.item_author_email(entry), self.author.email)
     self.assertEquals(
         feed.item_author_link(entry),
         'http://example.com/authors/%s/' % self.author.username)
     self.assertEquals(feed.item_enclosure_url(entry),
                       'http://example.com/image.jpg')
     self.assertEquals(feed.item_enclosure_length(entry), '100000')
     self.assertEquals(feed.item_enclosure_mime_type(entry), 'image/jpeg')
Esempio n. 4
0
 def test_entry_feed(self):
     entry = self.create_published_entry()
     feed = EntryFeed()
     self.assertEqual(feed.item_pubdate(entry), entry.creation_date)
     self.assertEqual(feed.item_categories(entry), [self.category.title])
     self.assertEqual(feed.item_author_name(entry), self.author.__str__())
     self.assertEqual(feed.item_author_email(entry), self.author.email)
     self.assertEqual(
         feed.item_author_link(entry),
         'http://example.com/authors/%s/' % self.author.username)
     # Test a NoReverseMatch for item_author_link
     self.author.username = '******'
     self.author.save()
     feed.item_author_name(entry)
     self.assertEqual(feed.item_author_link(entry), 'http://example.com')
Esempio n. 5
0
 def test_entry_feed(self):
     entry = self.create_published_entry()
     feed = EntryFeed()
     self.assertEquals(feed.item_pubdate(entry), entry.creation_date)
     self.assertEquals(feed.item_categories(entry), [self.category.title])
     self.assertEquals(feed.item_author_name(entry),
                       self.author.__unicode__())
     self.assertEquals(feed.item_author_email(entry), self.author.email)
     self.assertEquals(
         feed.item_author_link(entry),
         'http://example.com/authors/%s/' % self.author.username)
     # Test a NoReverseMatch for item_author_link
     self.author.username = '******'
     self.author.save()
     feed.item_author_name(entry)
     self.assertEquals(feed.item_author_link(entry), 'http://example.com')
Esempio n. 6
0
 def test_entry_feed(self):
     original_feeds_format = feeds.FEEDS_FORMAT
     feeds.FEEDS_FORMAT = ""
     entry = self.create_published_entry()
     feed = EntryFeed()
     self.assertEquals(feed.item_pubdate(entry), entry.creation_date)
     self.assertEquals(feed.item_categories(entry), [self.category.title])
     self.assertEquals(feed.item_author_name(entry), self.author.username)
     self.assertEquals(feed.item_author_email(entry), self.author.email)
     self.assertEquals(feed.item_author_link(entry), "http://example.com/authors/%s/" % self.author.username)
     # Test a NoReverseMatch for item_author_link
     self.author.username = "******"
     self.author.save()
     feed.item_author_name(entry)
     self.assertEquals(feed.item_author_link(entry), "http://example.com")
     feeds.FEEDS_FORMAT = original_feeds_format
Esempio n. 7
0
 def test_entry_feed(self):
     original_feeds_format = feeds.FEEDS_FORMAT
     feeds.FEEDS_FORMAT = ''
     entry = self.create_published_entry()
     feed = EntryFeed()
     self.assertEquals(feed.item_pubdate(entry), entry.creation_date)
     self.assertEquals(feed.item_categories(entry), [self.category.title])
     self.assertEquals(feed.item_author_name(entry), self.author.username)
     self.assertEquals(feed.item_author_email(entry), self.author.email)
     self.assertEquals(feed.item_author_link(entry),
                       'http://example.com/authors/%s/' % self.author.username)
     self.author.username = '******'  # Test a NoReverseMatch for item_author_link
     self.author.save()
     feed.item_author_name(entry)
     self.assertEquals(feed.item_author_link(entry), 'http://example.com')
     feeds.FEEDS_FORMAT = original_feeds_format