Skip to content

Commit

Permalink
test: test commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Faraz Maqsood committed Oct 13, 2024
1 parent cc68bd7 commit 0ff43a0
Showing 1 changed file with 52 additions and 1 deletion.
53 changes: 52 additions & 1 deletion lms/djangoapps/discussion/rest_api/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,19 @@ def setUp(self):
Setup test case
"""
super().setUp()

patcher = mock.patch('lms.djangoapps.discussion.toggles.ENABLE_FORUM_V2.is_enabled', return_value=False)
patcher.start()
self.addCleanup(patcher.stop)
patcher = mock.patch(
"openedx.core.djangoapps.django_comment_common.comment_client.thread.forum_api.get_course_id_by_thread"
)
self.mock_get_course_id_by_thread = patcher.start()
self.addCleanup(patcher.stop)
patcher = mock.patch(
"openedx.core.djangoapps.django_comment_common.comment_client.models.forum_api.get_course_id_by_comment"
)
self.mock_get_course_id_by_comment = patcher.start()
self.addCleanup(patcher.stop)
# Creating a course
self.course = CourseFactory.create()

Expand Down Expand Up @@ -250,6 +262,19 @@ def setUp(self):
super().setUp()
httpretty.reset()
httpretty.enable()
patcher = mock.patch('lms.djangoapps.discussion.toggles.ENABLE_FORUM_V2.is_enabled', return_value=False)
patcher.start()
self.addCleanup(patcher.stop)
patcher = mock.patch(
"openedx.core.djangoapps.django_comment_common.comment_client.thread.forum_api.get_course_id_by_thread"
)
self.mock_get_course_id_by_thread = patcher.start()
self.addCleanup(patcher.stop)
patcher = mock.patch(
"openedx.core.djangoapps.django_comment_common.comment_client.models.forum_api.get_course_id_by_comment"
)
self.mock_get_course_id_by_comment = patcher.start()
self.addCleanup(patcher.stop)

self.course = CourseFactory.create()
self.user_1 = UserFactory.create()
Expand Down Expand Up @@ -538,6 +563,19 @@ def setUp(self):
super().setUp()
httpretty.reset()
httpretty.enable()
patcher = mock.patch('lms.djangoapps.discussion.toggles.ENABLE_FORUM_V2.is_enabled', return_value=False)
patcher.start()
self.addCleanup(patcher.stop)
patcher = mock.patch(
"openedx.core.djangoapps.django_comment_common.comment_client.models.forum_api.get_course_id_by_comment"
)
self.mock_get_course_id_by_comment = patcher.start()
self.addCleanup(patcher.stop)
patcher = mock.patch(
"openedx.core.djangoapps.django_comment_common.comment_client.thread.forum_api.get_course_id_by_thread"
)
self.mock_get_course_id_by_thread = patcher.start()
self.addCleanup(patcher.stop)

self.course = CourseFactory.create()
self.user_1 = UserFactory.create()
Expand Down Expand Up @@ -605,6 +643,19 @@ def setUp(self):
super().setUp()
httpretty.reset()
httpretty.enable()
patcher = mock.patch('lms.djangoapps.discussion.toggles.ENABLE_FORUM_V2.is_enabled', return_value=False)
patcher.start()
self.addCleanup(patcher.stop)
patcher = mock.patch(
"openedx.core.djangoapps.django_comment_common.comment_client.thread.forum_api.get_course_id_by_thread"
)
self.mock_get_course_id_by_thread = patcher.start()
self.addCleanup(patcher.stop)
patcher = mock.patch(
"openedx.core.djangoapps.django_comment_common.comment_client.models.forum_api.get_course_id_by_comment"
)
self.mock_get_course_id_by_comment = patcher.start()
self.addCleanup(patcher.stop)

self.course = CourseFactory.create()
self.user_1 = UserFactory.create()
Expand Down

0 comments on commit 0ff43a0

Please sign in to comment.