fix: Allow tests for Extracted & Builtin Annotatable XBlock (#36246)

Test Annotatable XBlock in both built-in and extracted modes to keep them in sync.

Related to: https://github.com/openedx/edx-platform/issues/34841
This commit is contained in:
Irtaza Akram
2025-08-15 20:44:04 +05:00
committed by GitHub
parent bbfdce0f9a
commit 35adeafafd
2 changed files with 35 additions and 9 deletions

View File

@@ -202,8 +202,17 @@ class _BuiltInAnnotatableBlock(
return fragment
AnnotatableBlock = (
_ExtractedAnnotatableBlock if settings.USE_EXTRACTED_ANNOTATABLE_BLOCK
else _BuiltInAnnotatableBlock
)
AnnotatableBlock = None
def reset_class():
"""Reset class as per django settings flag"""
global AnnotatableBlock
AnnotatableBlock = (
_ExtractedAnnotatableBlock if settings.USE_EXTRACTED_ANNOTATABLE_BLOCK else _BuiltInAnnotatableBlock
)
return AnnotatableBlock
reset_class()
AnnotatableBlock.__name__ = "AnnotatableBlock"