'Test that map view can be properly rendered'

def test_map_view(self):

    self.client.login(username=self.user, password=self.passwd)
    new_map = reverse('new_map_json')
    response = self.client.post(new_map, data=self.viewer_config, content_type='text/json')
    self.assertEquals(response.status_code, 200)
    map_id = int(json.loads(response.content)['id'])
    self.client.logout()
    url = reverse('map_view', args=(map_id,))
    response = self.client.get(url)
    self.assertEquals(response.status_code, 200)
    self.client.login(username='norman', password='norman')
    response = self.client.get(url)
    self.assertEquals(response.status_code, 200)
    self.client.logout()
    self.client.login(username=self.user, password=self.passwd)
    response = self.client.get(url)
    self.assertEquals(response.status_code, 200)
    map_obj = Map.objects.get(id=map_id)
    config_map = map_obj.viewer_json(None, None)
    response_config_dict = json.loads(response.context['config'])
    self.assertEquals(config_map['about']['abstract'], response_config_dict['about']['abstract'])
    self.assertEquals(config_map['about']['title'], response_config_dict['about']['title'])
