Remove another XML course test.
This commit is contained in:
@@ -88,7 +88,6 @@ class CommonMixedModuleStoreSetup(CourseComparisonTest):
|
||||
'collection': COLLECTION,
|
||||
'asset_collection': ASSET_COLLECTION,
|
||||
}
|
||||
MAPPINGS = {}
|
||||
OPTIONS = {
|
||||
'stores': [
|
||||
{
|
||||
@@ -241,7 +240,7 @@ class CommonMixedModuleStoreSetup(CourseComparisonTest):
|
||||
return self.store.has_changes(self.store.get_item(location))
|
||||
|
||||
# pylint: disable=dangerous-default-value
|
||||
def _initialize_mixed(self, mappings=MAPPINGS, contentstore=None):
|
||||
def _initialize_mixed(self, mappings={}, contentstore=None):
|
||||
"""
|
||||
initializes the mixed modulestore.
|
||||
"""
|
||||
|
||||
@@ -32,12 +32,9 @@ from student.tests.factories import UserFactory
|
||||
from xmodule.modulestore.django import _get_modulestore_branch_setting, modulestore
|
||||
from xmodule.modulestore import ModuleStoreEnum
|
||||
from xmodule.modulestore.xml_importer import import_course_from_xml
|
||||
from xmodule.modulestore.tests.django_utils import (
|
||||
ModuleStoreTestCase,
|
||||
TEST_DATA_MIXED_MODULESTORE
|
||||
)
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import (
|
||||
CourseFactory, ItemFactory, ToyCourseFactory, check_mongo_calls
|
||||
CourseFactory, ItemFactory, check_mongo_calls
|
||||
)
|
||||
from xmodule.tests.xml import factories as xml
|
||||
from xmodule.tests.xml import XModuleXmlImportTest
|
||||
@@ -307,35 +304,6 @@ class CoursesRenderTest(ModuleStoreTestCase):
|
||||
self.assertIn("this module is temporarily unavailable", course_about)
|
||||
|
||||
|
||||
@attr('shard_1')
|
||||
class XmlCoursesRenderTest(ModuleStoreTestCase):
|
||||
"""Test methods related to rendering courses content for an XML course."""
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
Make sure that course is reloaded every time--clear out the modulestore.
|
||||
"""
|
||||
super(XmlCoursesRenderTest, self).setUp()
|
||||
self.toy_course_key = ToyCourseFactory.create().id
|
||||
|
||||
def test_get_course_info_section_render(self):
|
||||
course = get_course_by_id(self.toy_course_key)
|
||||
request = get_request_for_user(UserFactory.create())
|
||||
|
||||
# Test render works okay. Note the href is different in XML courses.
|
||||
course_info = get_course_info_section(request, request.user, course, 'handouts')
|
||||
self.assertEqual(course_info, "<a href='/static/toy/handouts/sample_handout.txt'>Sample</a>")
|
||||
|
||||
# Test when render raises an exception
|
||||
with mock.patch('courseware.courses.get_module') as mock_module_render:
|
||||
mock_module_render.return_value = mock.MagicMock(
|
||||
render=mock.Mock(side_effect=Exception('Render failed!'))
|
||||
)
|
||||
course_info = get_course_info_section(request, request.user, course, 'handouts')
|
||||
self.assertIn("this module is temporarily unavailable", course_info)
|
||||
|
||||
|
||||
@attr('shard_1')
|
||||
@ddt.ddt
|
||||
class CourseInstantiationTests(ModuleStoreTestCase):
|
||||
|
||||
Reference in New Issue
Block a user