mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Refs #13110 -- Fixed mistakes in the new multiple enclosure feed tests
This commit is contained in:
parent
1a09b3c398
commit
a4b80e2421
@ -427,7 +427,7 @@ class Atom1Feed(SyndicationFeed):
|
||||
handler.addQuickElement("summary", item['description'], {"type": "html"})
|
||||
|
||||
# Enclosures.
|
||||
for enclosure in item.get('enclosures') or []:
|
||||
for enclosure in item['enclosures']:
|
||||
handler.addQuickElement('link', '', {
|
||||
'rel': 'enclosure',
|
||||
'href': enclosure.url,
|
||||
|
@ -208,6 +208,6 @@ class TestMultipleEnclosureAtomFeed(TestAtomFeed):
|
||||
"""
|
||||
def item_enclosures(self, item):
|
||||
return [
|
||||
feedgenerator.Enclosure('http://example.com/hello.png', 0, 'image/png'),
|
||||
feedgenerator.Enclosure('http://example.com/goodbye.png', 0, 'image/png'),
|
||||
feedgenerator.Enclosure('http://example.com/hello.png', '0', 'image/png'),
|
||||
feedgenerator.Enclosure('http://example.com/goodbye.png', '0', 'image/png'),
|
||||
]
|
||||
|
@ -300,7 +300,7 @@ class SyndicationFeedTest(FeedTestCase):
|
||||
self.assertNotEqual(published, updated)
|
||||
|
||||
def test_atom_single_enclosure(self):
|
||||
response = self.client.get('/syndication/rss2/single-enclosure/')
|
||||
response = self.client.get('/syndication/atom/single-enclosure/')
|
||||
feed = minidom.parseString(response.content).firstChild
|
||||
items = feed.getElementsByTagName('entry')
|
||||
for item in items:
|
||||
@ -309,7 +309,7 @@ class SyndicationFeedTest(FeedTestCase):
|
||||
self.assertEqual(len(links), 1)
|
||||
|
||||
def test_atom_multiple_enclosures(self):
|
||||
response = self.client.get('/syndication/rss2/single-enclosure/')
|
||||
response = self.client.get('/syndication/atom/multiple-enclosure/')
|
||||
feed = minidom.parseString(response.content).firstChild
|
||||
items = feed.getElementsByTagName('entry')
|
||||
for item in items:
|
||||
|
Loading…
Reference in New Issue
Block a user