def test_atom_feed(self):
    '\n        Test the structure and content of feeds generated by Atom1Feed.\n        '
    response = self.client.get('/syndication/atom/')
    feed = minidom.parseString(response.content).firstChild
    self.assertEqual(feed.nodeName, 'feed')
    self.assertEqual(feed.getAttribute('xmlns'), 'http://www.w3.org/2005/Atom')
    self.assertChildNodes(feed, ['title', 'subtitle', 'link', 'id', 'updated', 'entry', 'rights', 'category', 'author'])
    for link in feed.getElementsByTagName('link'):
        if (link.getAttribute('rel') == 'self'):
            self.assertEqual(link.getAttribute('href'), 'http://example.com/syndication/atom/')
    entries = feed.getElementsByTagName('entry')
    self.assertEqual(len(entries), Entry.objects.count())
    for entry in entries:
        self.assertChildNodes(entry, ['title', 'link', 'id', 'summary', 'category', 'updated', 'published', 'rights', 'author'])
        summary = entry.getElementsByTagName('summary')[0]
        self.assertEqual(summary.getAttribute('type'), 'html')
Test the structure and content of feeds generated by Atom1Feed.
def test_atom_feed(self):
    '\n        \n        '
    response = self.client.get('/syndication/atom/')
    feed = minidom.parseString(response.content).firstChild
    self.assertEqual(feed.nodeName, 'feed')
    self.assertEqual(feed.getAttribute('xmlns'), 'http://www.w3.org/2005/Atom')
    self.assertChildNodes(feed, ['title', 'subtitle', 'link', 'id', 'updated', 'entry', 'rights', 'category', 'author'])
    for link in feed.getElementsByTagName('link'):
        if (link.getAttribute('rel') == 'self'):
            self.assertEqual(link.getAttribute('href'), 'http://example.com/syndication/atom/')
    entries = feed.getElementsByTagName('entry')
    self.assertEqual(len(entries), Entry.objects.count())
    for entry in entries:
        self.assertChildNodes(entry, ['title', 'link', 'id', 'summary', 'category', 'updated', 'published', 'rights', 'author'])
        summary = entry.getElementsByTagName('summary')[0]
        self.assertEqual(summary.getAttribute('type'), 'html')