Skip to content

Commit 40c1544

Browse files
author
alenkadev
committed
feat: enable EdxNotes by default and update related tests
1 parent 8c2863e commit 40c1544

4 files changed

Lines changed: 10 additions & 8 deletions

File tree

lms/djangoapps/edxnotes/helpers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ def get_edxnotes_id_token(user):
5757
try:
5858
notes_application = Application.objects.get(name=settings.EDXNOTES_CLIENT_NAME)
5959
except Application.DoesNotExist:
60-
raise ImproperlyConfigured( # lint-amnesty, pylint: disable=raise-missing-from
61-
f'OAuth2 Client with name [{settings.EDXNOTES_CLIENT_NAME}] does not exist.'
60+
log.warning(
61+
'OAuth2 Client with name [%s] does not exist. EdxNotes will be disabled.',
62+
settings.EDXNOTES_CLIENT_NAME
6263
)
64+
return None
6365
return create_jwt_for_user(
6466
user, secret=notes_application.client_secret, aud=notes_application.client_id
6567
)

openedx/core/djangoapps/course_apps/tests/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ def get_app_tab(self, course_key):
8585
course = self.store.get_course(course_key)
8686
return next((tab for tab in course.tabs if tab.type == self.tab_type), None)
8787

88-
def test_app_disabled_by_default(self):
88+
def test_app_enabled_by_default(self):
8989
"""
90-
Test that the app tab is disabled by default.
90+
Test that the app tab is enabled by default.
9191
"""
92-
assert not self.course_app_class.is_enabled(self.course.id)
92+
assert self.course_app_class.is_enabled(self.course.id)
9393

9494
def test_app_enabling(self):
9595
"""

xmodule/modulestore/inheritance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class InheritanceMixin(XBlockMixin):
210210
edxnotes = Boolean(
211211
display_name=_("Enable Student Notes"),
212212
help=_("Enter true or false. If true, students can use the Student Notes feature."),
213-
default=False,
213+
default=True,
214214
scope=Scope.settings
215215
)
216216
edxnotes_visibility = Boolean(

xmodule/tests/test_split_test_block.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def setUp(self):
122122
mocked_modulestore.get_course.return_value = self.course
123123
self.split_test_block.runtime.modulestore = mocked_modulestore
124124

125-
125+
@patch.dict("django.conf.settings.FEATURES", {"ENABLE_EDXNOTES": False})
126126
@ddt.ddt
127127
class SplitTestBlockLMSTest(SplitTestBlockTest):
128128
"""
@@ -185,7 +185,7 @@ def test_export_import_round_trip(self, def_to_xml):
185185
assert fields.get('group_id_to_child') is not None
186186
assert len(children) == 2
187187

188-
188+
@patch.dict("django.conf.settings.FEATURES", {"ENABLE_EDXNOTES": False})
189189
class SplitTestBlockStudioTest(SplitTestBlockTest):
190190
"""
191191
Unit tests for how split test interacts with Studio.

0 commit comments

Comments
 (0)