'Make some assertions about the data structure produced for serialization
to a JSON map configuration'

def test_map_to_json(self):

    map_obj = Map.objects.get(id=1)
    cfg = map_obj.viewer_json(None, None)
    self.assertEquals(cfg['about']['abstract'], 'GeoNode    default    map    abstract')
    self.assertEquals(cfg['about']['title'], 'GeoNode    Default    Map')
    def is_wms_layer(x):
        if ('source' in x):
            return (cfg['sources'][x['source']]['ptype'] == 'gxp_wmscsource')
        return False
    layernames = [x['name'] for x in cfg['map']['layers'] if is_wms_layer(x)]
    self.assertEquals(layernames, ['geonode:CA'])
