Commit 8d858ecb by Chris Dodge

add a unit test to exercise the preview_component AJAX callback in the CMS

parent 63ed16e1
...@@ -344,6 +344,21 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): ...@@ -344,6 +344,21 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
err_cnt = perform_xlint('common/test/data', ['full']) err_cnt = perform_xlint('common/test/data', ['full'])
self.assertGreater(err_cnt, 0) self.assertGreater(err_cnt, 0)
def test_module_preview(self):
'''
Tests the ajax callback to render an XModule
'''
direct_store = modulestore('direct')
import_from_xml(direct_store, 'common/test/data/', ['full'])
html_module_location = Location(['i4x', 'edX', 'full', 'html', 'html_90', None])
url = reverse('preview_component', kwargs={'location': html_module_location.url()})
resp = self.client.get(url)
self.assertEqual(resp.status_code, 200)
self.assertIn('Inline content', resp.content)
def test_delete(self): def test_delete(self):
direct_store = modulestore('direct') direct_store = modulestore('direct')
import_from_xml(direct_store, 'common/test/data/', ['full']) import_from_xml(direct_store, 'common/test/data/', ['full'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment