'Test if moderation flag works'

def test_moderated_upload(self):

    with self.settings(ADMIN_MODERATE_UPLOADS=False):
        self.client.login(username=self.user, password=self.passwd)
        new_map = reverse('new_map_json')
        response = self.client.post(new_map, data=VIEWER_CONFIG, content_type='text/json')
        self.assertEquals(response.status_code, 200)
        map_id = int(json.loads(response.content)['id'])
        l = Map.objects.get(id=map_id)
        self.assertTrue(l.is_published)
    with self.settings(ADMIN_MODERATE_UPLOADS=True):
        self.client.login(username=self.user, password=self.passwd)
        new_map = reverse('new_map_json')
        response = self.client.post(new_map, data=VIEWER_CONFIG, content_type='text/json')
        self.assertEquals(response.status_code, 200)
        map_id = int(json.loads(response.content)['id'])
        l = Map.objects.get(id=map_id)
        self.assertFalse(l.is_published)
