'Test that map metadata can be properly rendered'

def test_map_metadata(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_metadata', args=(map_id,))
    response = self.client.post(url)
    self.assertEquals(response.status_code, 302)
    self.client.login(username='norman', password='norman')
    response = self.client.post(url)
    self.assertEquals(response.status_code, 302)
    self.client.logout()
    self.client.login(username=self.user, password=self.passwd)
    response = self.client.get(url)
    self.assertEquals(response.status_code, 200)
    self.client.login(username=self.user, password=self.passwd)
    response = self.client.post(url)
    self.assertEquals(response.status_code, 200)
