diff --git a/cms/envs/test.py b/cms/envs/test.py index cf27e957bd..a42b73336a 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -42,7 +42,8 @@ from lms.envs.test import ( # pylint: disable=wrong-import-order REGISTRATION_EXTRA_FIELDS, GRADES_DOWNLOAD, SITE_NAME, - WIKI_ENABLED + WIKI_ENABLED, + XBLOCK_RUNTIME_V2_EPHEMERAL_DATA_CACHE, ) @@ -177,6 +178,12 @@ CACHES = { 'course_structure_cache': { 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', }, + 'blockstore': { + 'KEY_PREFIX': 'blockstore', + 'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key', + 'LOCATION': 'edx_loc_mem_cache', + 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', + }, } ############################### BLOCKSTORE ##################################### @@ -276,12 +283,6 @@ TEST_ELASTICSEARCH_USE_SSL = os.environ.get( TEST_ELASTICSEARCH_HOST = os.environ.get('EDXAPP_TEST_ELASTICSEARCH_HOST', 'edx.devstack.elasticsearch710') TEST_ELASTICSEARCH_PORT = int(os.environ.get('EDXAPP_TEST_ELASTICSEARCH_PORT', '9200')) -############################# TEMPLATE CONFIGURATION ############################# -# Adds mako template dirs for content_libraries tests -MAKO_TEMPLATE_DIRS_BASE.append( - COMMON_ROOT / 'lib' / 'capa' / 'capa' / 'templates' -) - ########################## AUTHOR PERMISSION ####################### FEATURES['ENABLE_CREATOR_GROUP'] = False diff --git a/common/test/problem.html b/common/test/problem.html deleted file mode 100644 index 0c63e205e0..0000000000 --- a/common/test/problem.html +++ /dev/null @@ -1,96 +0,0 @@ - -<%page expression_filter="h"/> -<%! -from django.utils.translation import ngettext, gettext as _ -from openedx.core.djangolib.markup import HTML -%> - -<%namespace name='static' file='static_content.html'/> -

- ${ problem['name'] } -

- -
- -
- ${ HTML(problem['html']) } -
- - -
- % if demand_hint_possible: - - - - % endif - % if save_button: - - - - % endif - % if reset_button: - - - - % endif - % if answer_available: - - - - % endif -
-
- - - % if submit_disabled_cta: - % if submit_disabled_cta.get('event_data'): - - - - - (${submit_disabled_cta['description']}) - % else: -
- - % for form_name, form_value in submit_disabled_cta['form_values'].items(): - - % endfor - - - - - (${submit_disabled_cta['description']}) -
- % endif - % endif -
- ## When attempts are not 0, the CTA above will contain a message about the number of used attempts - % if attempts_allowed and (not submit_disabled_cta or attempts_used == 0): - ${ngettext("You have used {num_used} of {num_total} attempt", "You have used {num_used} of {num_total} attempts", attempts_allowed).format(num_used=attempts_used, num_total=attempts_allowed)} - % endif - ${_("Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.")} -
-
-
-
- - diff --git a/common/test/problem_ajax.html b/common/test/problem_ajax.html deleted file mode 100644 index bbe365bd92..0000000000 --- a/common/test/problem_ajax.html +++ /dev/null @@ -1,16 +0,0 @@ - -
-

- - Loading… -

-
diff --git a/common/test/video.html b/common/test/video.html deleted file mode 100644 index ea6a54d994..0000000000 --- a/common/test/video.html +++ /dev/null @@ -1,122 +0,0 @@ - -<%page expression_filter="h"/> - -<%! -from django.utils.translation import ugettext as _ -from openedx.core.djangolib.js_utils import ( - dump_js_escaped_json, js_escaped_string -) -%> -% if display_name is not UNDEFINED and display_name is not None: -

${display_name}

-% endif - -
-
- -
-
- - -
-
-
- - -
-
-
- -
-
- -
- - % if download_video_link or track or handout or branding_info: -

${_('Downloads and transcripts')}

-
- % if download_video_link: - - % endif - % if track: -
-

${_('Transcripts')}

- % if transcript_download_format: -
    - % for item in transcript_download_formats_list: -
  • - <% dname = _("Download {file}").format(file=item['display_name']) %> - ${dname} -
  • - % endfor -
- % else: - ${_('Download transcript')} - % endif -
- % endif - % if handout: -
-

${_('Handouts')}

- ${_('Download Handout')} -
- % endif - % if branding_info: -
- ${branding_info['logo_tag']} - -
- % endif -
- % endif -
-% if cdn_eval: - -% endif; diff --git a/openedx/core/djangoapps/content_libraries/tests/test_runtime.py b/openedx/core/djangoapps/content_libraries/tests/test_runtime.py index 62798f97a5..cf9da3dff3 100644 --- a/openedx/core/djangoapps/content_libraries/tests/test_runtime.py +++ b/openedx/core/djangoapps/content_libraries/tests/test_runtime.py @@ -6,7 +6,7 @@ from gettext import GNUTranslations from completion.test_utils import CompletionWaffleTestMixin from django.db import connections -from django.test import LiveServerTestCase, TestCase, override_settings +from django.test import LiveServerTestCase, TestCase from django.utils.text import slugify from organizations.models import Organization from rest_framework.test import APIClient @@ -182,8 +182,6 @@ class ContentLibraryRuntimeTestMixin(ContentLibraryContentTestMixin): @requires_blockstore -# EphemeralKeyValueStore requires a working cache, and the default test cache doesn't work: -@override_settings(XBLOCK_RUNTIME_V2_EPHEMERAL_DATA_CACHE='blockstore') class ContentLibraryRuntimeBServiceTest(ContentLibraryRuntimeTestMixin, TestCase): """ Tests XBlock runtime using XBlocks in a content library using the standalone Blockstore service. @@ -191,8 +189,6 @@ class ContentLibraryRuntimeBServiceTest(ContentLibraryRuntimeTestMixin, TestCase @requires_blockstore_app -# EphemeralKeyValueStore requires a working cache, and the default test cache doesn't work: -@override_settings(XBLOCK_RUNTIME_V2_EPHEMERAL_DATA_CACHE='blockstore') class ContentLibraryRuntimeTest(ContentLibraryRuntimeTestMixin, BlockstoreAppTestMixin, LiveServerTestCase): """ Tests XBlock runtime using XBlocks in a content library using the installed Blockstore app. diff --git a/openedx/core/djangoapps/xblock/runtime/runtime.py b/openedx/core/djangoapps/xblock/runtime/runtime.py index 444ba33488..ba06df6da5 100644 --- a/openedx/core/djangoapps/xblock/runtime/runtime.py +++ b/openedx/core/djangoapps/xblock/runtime/runtime.py @@ -241,6 +241,8 @@ class XBlockRuntime(RuntimeShim, Runtime): anonymous_user_id=self.anonymous_student_id, ) elif service_name == "mako": + if self.system.student_data_mode == XBlockRuntimeSystem.STUDENT_DATA_EPHEMERAL: + return MakoService(namespace_prefix='lms.') return MakoService() elif service_name == "i18n": return ModuleI18nService(block=block)