Fixed feedgenerator tests under hash randomization

This commit is contained in:
Aymeric Augustin 2012-10-26 22:40:35 +02:00
parent 195bc37f1d
commit 46d27a6b8d
1 changed files with 6 additions and 2 deletions

View File

@ -104,10 +104,14 @@ class FeedgeneratorTest(unittest.TestCase):
feed = feedgenerator.Rss201rev2Feed('title', '/link/', 'descr') feed = feedgenerator.Rss201rev2Feed('title', '/link/', 'descr')
self.assertEqual(feed.feed['feed_url'], None) self.assertEqual(feed.feed['feed_url'], None)
feed_content = feed.writeString('utf-8') feed_content = feed.writeString('utf-8')
self.assertNotIn('<atom:link href=', feed_content) self.assertNotIn('<atom:link', feed_content)
self.assertNotIn('href="/feed/"', feed_content)
self.assertNotIn('rel="self"', feed_content)
def test_feed_with_feed_url_gets_rendered_with_atom_link(self): def test_feed_with_feed_url_gets_rendered_with_atom_link(self):
feed = feedgenerator.Rss201rev2Feed('title', '/link/', 'descr', feed_url='/feed/') feed = feedgenerator.Rss201rev2Feed('title', '/link/', 'descr', feed_url='/feed/')
self.assertEqual(feed.feed['feed_url'], '/feed/') self.assertEqual(feed.feed['feed_url'], '/feed/')
feed_content = feed.writeString('utf-8') feed_content = feed.writeString('utf-8')
self.assertIn('<atom:link href="/feed/" rel="self"></atom:link>', feed_content) self.assertIn('<atom:link', feed_content)
self.assertIn('href="/feed/"', feed_content)
self.assertIn('rel="self"', feed_content)