Skip to content

Commit baa8142

Browse files
author
alenkadev
committed
fix: mock OAuth2 application lookup in SplitTestBlockTest to avoid infrastructure requirement
1 parent c49bc19 commit baa8142

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

xmodule/tests/test_split_test_block.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,12 @@ class SplitTestBlockTest(XModuleXmlImportTest, PartitionTestCase):
6868
"""
6969
def setUp(self):
7070
super().setUp()
71-
# Mock the OAuth2 client lookup for edxnotes to avoid infrastructure requirement in tests
72-
oauth2_patcher = patch('lms.djangoapps.edxnotes.helpers.get_edxnotes_id_token', return_value='test-token')
71+
# Mock the OAuth2 application lookup for edxnotes to avoid infrastructure requirement
72+
from oauth2_provider.models import Application
73+
mock_app = Mock(spec=Application)
74+
mock_app.client_id = 'edx-notes-test'
75+
mock_app.client_secret = 'test-secret'
76+
oauth2_patcher = patch('oauth2_provider.models.Application.objects.get', return_value=mock_app)
7377
oauth2_patcher.start()
7478
self.addCleanup(oauth2_patcher.stop)
7579

0 commit comments

Comments
 (0)