'Tests the ajax callback to render an XModule'

def test_module_preview_in_whitelist(self):

    with override_settings(COURSES_WITH_UNSAFE_CODE=[unicode(self.course.id)]):
        resp = self.client.get_json(get_url('xblock_view_handler', self.vert_loc, kwargs={'view_name': 'container_preview'}))
        self.assertEqual(resp.status_code, 200)
        vertical = self.store.get_item(self.vert_loc)
        for child in vertical.children:
            self.assertContains(resp, unicode(child))
