From f76b6b4e10866acdf5cf56945bdca01d9c5ff3ac Mon Sep 17 00:00:00 2001 From: salmannawaz Date: Wed, 14 Feb 2024 19:42:08 +0500 Subject: [PATCH] Remove bok-choy reference (#34216) * chore: remove bok-choy references --- .../contentstore/xblock_storage_handlers/view_handlers.py | 1 - lms/envs/common.py | 5 ++--- openedx/core/djangoapps/cache_toolbox/middleware.py | 3 +-- openedx/tests/xblock_integration/xblock_testcase.py | 2 -- .../assets/library_content/public/js/library_content_edit.js | 2 -- xmodule/library_content_block.py | 1 - 6 files changed, 3 insertions(+), 11 deletions(-) diff --git a/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py b/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py index 8b122d8c8da0..44b89aa3a5f5 100644 --- a/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py +++ b/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py @@ -498,7 +498,6 @@ def _save_xblock( publish = "make_public" # Make public after updating the xblock, in case the caller asked for both an update and a publish. - # Used by Bok Choy tests and by republishing of staff locks. if publish == "make_public": modulestore().publish(xblock.location, user.id) diff --git a/lms/envs/common.py b/lms/envs/common.py index bf11453e9826..0ef257df0023 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -349,9 +349,8 @@ # .. toggle_implementation: DjangoSetting # .. toggle_default: False # .. toggle_description: Set to True to perform acceptance and load test. Auto auth view is responsible for load - # testing and is controlled by this feature flag. Auto-auth causes issues in Bok Choy tests because it resets the - # requesting user. Session verification (of CacheBackedAuthenticationMiddleware) is a security feature, but it - # can be turned off by enabling this feature flag. + # testing and is controlled by this feature flag. Session verification (of CacheBackedAuthenticationMiddleware) + # is a security feature, but it can be turned off by enabling this feature flag. # .. toggle_use_cases: open_edx # .. toggle_creation_date: 2013-07-25 # .. toggle_warning: If this has been set to True then the account activation email will be skipped. diff --git a/openedx/core/djangoapps/cache_toolbox/middleware.py b/openedx/core/djangoapps/cache_toolbox/middleware.py index 9d1ea2bf0690..050db6368558 100644 --- a/openedx/core/djangoapps/cache_toolbox/middleware.py +++ b/openedx/core/djangoapps/cache_toolbox/middleware.py @@ -135,8 +135,7 @@ def _verify_session_auth(self, request): """ Ensure that the user's session hash hasn't changed. """ - # Auto-auth causes issues in Bok Choy tests because it resets - # the requesting user. Since session verification is a + # Since session verification is a # security feature, we can turn it off when auto-auth is # enabled since auto-auth is highly insecure and only for # tests. diff --git a/openedx/tests/xblock_integration/xblock_testcase.py b/openedx/tests/xblock_integration/xblock_testcase.py index 7e6d9a9387f9..6f598a342cb1 100644 --- a/openedx/tests/xblock_integration/xblock_testcase.py +++ b/openedx/tests/xblock_integration/xblock_testcase.py @@ -84,8 +84,6 @@ class XBlockEventTestMixin: Good things to look at as developing the code: * Gabe's library for parsing events. This is nice. - * Bok choy has a nice Mongo search for events in the cohorts test - case. It is a little slow for the general case. * This is originally based on a cleanup of the EventTestMixin. We could work to converge those in some sensible way. """ diff --git a/xmodule/assets/library_content/public/js/library_content_edit.js b/xmodule/assets/library_content/public/js/library_content_edit.js index c961b05472a4..fea66e266120 100644 --- a/xmodule/assets/library_content/public/js/library_content_edit.js +++ b/xmodule/assets/library_content/public/js/library_content_edit.js @@ -7,8 +7,6 @@ window.LibraryContentAuthorView = function(runtime, element) { // But it is still inside this xblock's wrapper element, which we can easily find: var $wrapper = $element.parents('*[data-locator="' + usage_id + '"]'); - // We can't bind to the button itself because in the bok choy test environment, - // it may not yet exist at this point in time... not sure why. $wrapper.on('click', '.library-update-btn', function(e) { e.preventDefault(); // Update the XBlock with the latest matching content from the library: diff --git a/xmodule/library_content_block.py b/xmodule/library_content_block.py index e4c4af267a1f..ea037dab8901 100644 --- a/xmodule/library_content_block.py +++ b/xmodule/library_content_block.py @@ -500,7 +500,6 @@ def get_user_id(self): """ user_service = self.runtime.service(self, 'user') if user_service: - # May be None when creating bok choy test fixtures user_id = user_service.get_current_user().opt_attrs.get('edx-platform.user_id', None) else: user_id = None