'Tests GeoRSS geographic sitemaps.'

def test_geositemap_georss(self):

    from feeds import feed_dict
    doc = minidom.parseString(self.client.get('/sitemaps/georss.xml').content)
    urlset = doc.firstChild
    self.assertEqual(urlset.getAttribute(u'xmlns'), u'http://www.sitemaps.org/schemas/sitemap/0.9')
    self.assertEqual(urlset.getAttribute(u'xmlns:geo'), u'http://www.google.com/geo/schemas/sitemap/1.0')
    urls = urlset.getElementsByTagName('url')
    self.assertEqual(len(feed_dict), len(urls))
    for url in urls:
        self.assertChildNodes(url, ['loc', 'geo:geo'])
        geo_elem = url.getElementsByTagName('geo:geo')[0]
        geo_format = geo_elem.getElementsByTagName('geo:format')[0]
        self.assertEqual('georss', geo_format.childNodes[0].data)
