Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions openedx/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,7 @@ def _make_locale_paths(settings):
# .. toggle_warning: Not production-ready until https://github.com/openedx/edx-platform/issues/34841 is done.
# .. toggle_creation_date: 2024-11-10
# .. toggle_target_removal_date: 2025-06-01
USE_EXTRACTED_ANNOTATABLE_BLOCK = False
USE_EXTRACTED_ANNOTATABLE_BLOCK = True

# .. toggle_name: USE_EXTRACTED_POLL_QUESTION_BLOCK
# .. toggle_default: False
Expand All @@ -1686,7 +1686,7 @@ def _make_locale_paths(settings):
# .. toggle_warning: Not production-ready until https://github.com/openedx/edx-platform/issues/34839 is done.
# .. toggle_creation_date: 2024-11-10
# .. toggle_target_removal_date: 2025-06-01
USE_EXTRACTED_POLL_QUESTION_BLOCK = False
USE_EXTRACTED_POLL_QUESTION_BLOCK = True

# .. toggle_name: USE_EXTRACTED_LTI_BLOCK
# .. toggle_default: False
Expand Down
4 changes: 0 additions & 4 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,3 @@ django-debug-toolbar<6.0.0
# Issue: https://github.com/openedx/edx-platform/issues/37435
cryptography<46.0.0
pact-python<3.0.0

# This pin will be removed once the following PR is merged
# https://github.com/openedx/xblocks-contrib/pull/120
xblocks-contrib<0.9.0
6 changes: 2 additions & 4 deletions requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1277,10 +1277,8 @@ xblock-utils==4.0.0
# via
# edx-sga
# xblock-poll
xblocks-contrib==0.8.1
# via
# -c requirements/constraints.txt
# -r requirements/edx/bundled.in
xblocks-contrib==0.9.0
# via -r requirements/edx/bundled.in
xmlsec==1.3.14
# via
# -c requirements/constraints.txt
Expand Down
3 changes: 1 addition & 2 deletions requirements/edx/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2308,9 +2308,8 @@ xblock-utils==4.0.0
# -r requirements/edx/testing.txt
# edx-sga
# xblock-poll
xblocks-contrib==0.8.1
xblocks-contrib==0.9.0
# via
# -c requirements/constraints.txt
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
xmlsec==1.3.14
Expand Down
6 changes: 2 additions & 4 deletions requirements/edx/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1615,10 +1615,8 @@ xblock-utils==4.0.0
# -r requirements/edx/base.txt
# edx-sga
# xblock-poll
xblocks-contrib==0.8.1
# via
# -c requirements/constraints.txt
# -r requirements/edx/base.txt
xblocks-contrib==0.9.0
# via -r requirements/edx/base.txt
xmlsec==1.3.14
# via
# -c requirements/constraints.txt
Expand Down
6 changes: 2 additions & 4 deletions requirements/edx/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1708,10 +1708,8 @@ xblock-utils==4.0.0
# -r requirements/edx/base.txt
# edx-sga
# xblock-poll
xblocks-contrib==0.8.1
# via
# -c requirements/constraints.txt
# -r requirements/edx/base.txt
xblocks-contrib==0.9.0
# via -r requirements/edx/base.txt
xmlsec==1.3.14
# via
# -c requirements/constraints.txt
Expand Down
27 changes: 3 additions & 24 deletions xmodule/tests/test_word_cloud.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Test for Word Cloud Block functional logic."""
import json
import os
from unittest.mock import Mock

from django.conf import settings
Expand Down Expand Up @@ -68,33 +67,13 @@ def test_xml_import_export_cycle(self):
assert block.num_inputs == 3
assert block.num_top_words == 100

if settings.USE_EXTRACTED_WORD_CLOUD_BLOCK:
# For extracted XBlocks, we need to manually export the XML definition to a file to properly test the
# import/export cycle. This is because extracted XBlocks use XBlock core's `add_xml_to_node` method,
# which does not export the XML to a file like `XmlMixin.add_xml_to_node` does.
filepath = 'word_cloud/block_id.xml'
runtime.export_fs.makedirs(os.path.dirname(filepath), recreate=True)
with runtime.export_fs.open(filepath, 'wb') as fileObj:
runtime.export_to_xml(block, fileObj)
else:
node = etree.Element("unknown_root")
# This will export the olx to a separate file.
block.add_xml_to_node(node)
node = etree.Element("unknown_root")
Comment thread
ttqureshi marked this conversation as resolved.
# This will export the olx to a separate file.
block.add_xml_to_node(node)

with runtime.export_fs.open('word_cloud/block_id.xml') as f:
exported_xml = f.read()

if settings.USE_EXTRACTED_WORD_CLOUD_BLOCK:
# For extracted XBlocks, we need to remove the `xblock-family` attribute from the exported XML to ensure
# consistency with the original XML.
# This is because extracted XBlocks use the core XBlock's `add_xml_to_node` method, which includes this
# attribute, whereas `XmlMixin.add_xml_to_node` does not.
exported_xml_tree = etree.fromstring(exported_xml.encode('utf-8'))
etree.cleanup_namespaces(exported_xml_tree)
if 'xblock-family' in exported_xml_tree.attrib:
del exported_xml_tree.attrib['xblock-family']
exported_xml = etree.tostring(exported_xml_tree, encoding='unicode', pretty_print=True)

assert exported_xml == original_xml

def test_bad_ajax_request(self):
Expand Down
Loading