Date: Thu, 11 Jul 2013 12:05:18 -0400
Subject: [PATCH] Fixed the whitelist test to not use full course
---
.../contentstore/tests/test_contentstore.py | 11 ++++-------
common/test/data/toy/chapter/html_container.xml | 1 +
common/test/data/toy/course/2012_Fall.xml | 1 +
common/test/data/toy/html/toylab.html | 13 +++++++++++++
common/test/data/toy/html/toylab.xml | 1 +
common/test/data/toy/vertical/vertical_test.xml | 11 ++++++++++-
6 files changed, 30 insertions(+), 8 deletions(-)
create mode 100644 common/test/data/toy/chapter/html_container.xml
create mode 100644 common/test/data/toy/html/toylab.html
create mode 100644 common/test/data/toy/html/toylab.xml
diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py
index 7b2b3bddcd..b43ea46d7d 100644
--- a/cms/djangoapps/contentstore/tests/test_contentstore.py
+++ b/cms/djangoapps/contentstore/tests/test_contentstore.py
@@ -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
diff --git a/common/test/data/toy/chapter/html_container.xml b/common/test/data/toy/chapter/html_container.xml
new file mode 100644
index 0000000000..5691607f3b
--- /dev/null
+++ b/common/test/data/toy/chapter/html_container.xml
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/common/test/data/toy/course/2012_Fall.xml b/common/test/data/toy/course/2012_Fall.xml
index ded9713f17..b96f04042f 100644
--- a/common/test/data/toy/course/2012_Fall.xml
+++ b/common/test/data/toy/course/2012_Fall.xml
@@ -13,4 +13,5 @@
+
diff --git a/common/test/data/toy/html/toylab.html b/common/test/data/toy/html/toylab.html
new file mode 100644
index 0000000000..b2a4599cc6
--- /dev/null
+++ b/common/test/data/toy/html/toylab.html
@@ -0,0 +1,13 @@
+Lab 2A: Superposition Experiment
+
+<<<<<<< Updated upstream
+Isn't the toy course great?
+
+Let's add some markup that uses non-ascii characters.
+For example, we should be able to write words like encyclopædia, or foreign words like français.
+Looking beyond latin-1, we should handle math symbols: πr² ≤ ∞.
+And it shouldn't matter if we use entities or numeric codes — Ω ≠ π ≡ Ω ≠ π.
+
+=======
+Isn't the toy course great? — ≤
+>>>>>>> Stashed changes
diff --git a/common/test/data/toy/html/toylab.xml b/common/test/data/toy/html/toylab.xml
new file mode 100644
index 0000000000..ab78aeb494
--- /dev/null
+++ b/common/test/data/toy/html/toylab.xml
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/common/test/data/toy/vertical/vertical_test.xml b/common/test/data/toy/vertical/vertical_test.xml
index c74300f826..72ad1692ba 100644
--- a/common/test/data/toy/vertical/vertical_test.xml
+++ b/common/test/data/toy/vertical/vertical_test.xml
@@ -4,4 +4,13 @@