'Testing geographic feeds using W3C Geo.'

def test_geofeed_w3c(self):

    doc = minidom.parseString(self.client.get('/feeds/w3cgeo1/').content)
    feed = doc.firstChild
    self.assertEqual(feed.getAttribute(u'xmlns:geo'), u'http://www.w3.org/2003/01/geo/wgs84_pos#')
    chan = feed.getElementsByTagName('channel')[0]
    items = chan.getElementsByTagName('item')
    self.assertEqual(len(items), City.objects.count())
    for item in items:
        self.assertChildNodes(item, ['title', 'link', 'description', 'guid', 'geo:lat', 'geo:lon'])
    self.assertRaises(ValueError, self.client.get, '/feeds/w3cgeo2/')
    self.assertRaises(ValueError, self.client.get, '/feeds/w3cgeo3/')
