Commit 4e015eac by JonahStanley

Fixed the whitelist test to not use full course

parent d2632227
......@@ -351,25 +351,23 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
err_cnt = perform_xlint('common/test/data', ['toy'])
self.assertGreater(err_cnt, 0)
#FIX
@override_settings(COURSES_WITH_UNSAFE_CODE=['edX/full/.*'])
@override_settings(COURSES_WITH_UNSAFE_CODE=['edX/toy/.*'])
def test_module_preview_in_whitelist(self):
'''
Tests the ajax callback to render an XModule
'''
direct_store = modulestore('direct')
import_from_xml(direct_store, 'common/test/data/', ['full'])
import_from_xml(direct_store, 'common/test/data/', ['toy'])
html_module_location = Location(['i4x', 'edX', 'full', 'html', 'html_90', None])
html_module_location = Location(['i4x', 'edX', 'toy', 'html', 'toylab', 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)
# also try a custom response which will trigger the 'is this course in whitelist' logic
problem_module_location = Location(['i4x', 'edX', 'full', 'problem', 'H1P1_Energy', None])
problem_module_location = Location(['i4x', 'edX', 'toy', 'vertical', 'vertical_test', None])
url = reverse('preview_component', kwargs={'location': problem_module_location.url()})
resp = self.client.get(url)
self.assertEqual(resp.status_code, 200)
......@@ -643,7 +641,6 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
resp = self.client.get('http://localhost:8001/c4x/CDX/123123/asset/&images_circuits_Lab7Solution2.png')
self.assertEqual(resp.status_code, 400)
#FIX
def test_delete_course(self):
"""
This test will import a course, make a draft item, and delete it. This will also assert that the
......
<sequential><html filename="toylab.html" slug="toylab" format="Tutorial Index" graceperiod="1 day 12 hours 59 minutes 59 seconds" showanswer="attempted" rerandomize="never" name="Toy Lab"/></sequential>
\ No newline at end of file
......@@ -13,4 +13,5 @@
<chapter url_name="poll_test"/>
<chapter url_name="vertical_container"/>
<chapter url_name="handout_container"/>
<chapter url_name="html_container"/>
</course>
<b>Lab 2A: Superposition Experiment</b>
<<<<<<< Updated upstream
<p>Isn't the toy course great?</p>
<p>Let's add some markup that uses non-ascii characters.
For example, we should be able to write words like encyclop&aelig;dia, or foreign words like fran&ccedil;ais.
Looking beyond latin-1, we should handle math symbols: &pi;r&sup2 &le; &#8734.
And it shouldn't matter if we use entities or numeric codes &mdash; &Omega; &ne; &pi; &equiv; &#937; &#8800; &#960;.
</p>
=======
<p>Isn't the toy course great? — &le;</p>
>>>>>>> Stashed changes
<html filename="toylab.html"/>
\ No newline at end of file
......@@ -4,4 +4,13 @@
<answer id="yes">Yes</answer>
<answer id="no">No</answer>
</poll_question>
</sequential>
\ No newline at end of file
<problem><script type="loncapa/python">
a=5
</script><startouttext/>
Answer the question
<endouttext/>
<startouttext/>
<endouttext/>
<numericalresponse answer="$a"><responseparam type="tolerance" default="5%" name="tol" description="Numerical Tolerance"/><textline/></numericalresponse>
</problem>
</sequential>
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