Commit a4b80e24 authored by Unai Zalakain's avatar Unai Zalakain
Browse files

Refs #13110 -- Fixed mistakes in the new multiple enclosure feed tests

parent 1a09b3c3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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,
+2 −2
Original line number Diff line number Diff line
@@ -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'),
        ]
+2 −2
Original line number Diff line number Diff line
@@ -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: