From 664f3f7b80223f8bd705ff63b73981ccc76edb63 Mon Sep 17 00:00:00 2001 From: Jillian Vogel Date: Wed, 6 Nov 2024 18:09:39 +1030 Subject: [PATCH] test: fix lms tests --- .../content_libraries/tests/test_runtime.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/openedx/core/djangoapps/content_libraries/tests/test_runtime.py b/openedx/core/djangoapps/content_libraries/tests/test_runtime.py index e263bd3d84b..5fe5bb4eb1f 100644 --- a/openedx/core/djangoapps/content_libraries/tests/test_runtime.py +++ b/openedx/core/djangoapps/content_libraries/tests/test_runtime.py @@ -5,7 +5,7 @@ from completion.test_utils import CompletionWaffleTestMixin from django.db import connections, transaction -from django.test import TestCase +from django.test import TestCase, override_settings from django.utils.text import slugify import django.utils.translation from organizations.models import Organization @@ -243,6 +243,16 @@ def test_xblock_fields(self): assert block_saved.display_name == 'New Display Name' +# EphemeralKeyValueStore requires a working cache, and the default test cache is a dummy cache. +@override_settings( + XBLOCK_RUNTIME_V2_EPHEMERAL_DATA_CACHE='default', + CACHES={ + 'default': { + 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', + 'LOCATION': 'edx_loc_mem_cache', + }, + }, +) # We can remove the line below to enable this in Studio once we implement a session-backed # field data store which we can use for both studio users and anonymous users @skip_unless_lms