Skip to content

Commit

Permalink
test: [AXIMST-783] fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NiedielnitsevIvan committed Apr 11, 2024
1 parent 3bd818b commit fe52fa6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lms/djangoapps/courseware/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@
from lms.djangoapps.courseware.tests.helpers import MasqueradeMixin, get_expiration_banner_text, set_preview_mode
from lms.djangoapps.courseware.testutils import RenderXBlockTestMixin
from lms.djangoapps.courseware.toggles import (
COURSEWARE_MICROFRONTEND_DISCUSSION_SIDEBAR_OPEN_DISABLED,
COURSEWARE_MICROFRONTEND_SIDEBAR_DISABLED,
COURSEWARE_MICROFRONTEND_SEARCH_ENABLED,
COURSEWARE_OPTIMIZED_RENDER_XBLOCK,
COURSEWARE_SHOW_DEFAULT_RIGHT_SIDEBAR,
)
from lms.djangoapps.courseware.user_state_client import DjangoXBlockUserStateClient
from lms.djangoapps.courseware.views.views import (
Expand Down Expand Up @@ -3826,7 +3826,7 @@ def test_is_mfe_sidebar_enabled(self):

class TestMFEDiscussionSidebarEnabledAPI(SharedModuleStoreTestCase):
"""
Tests the endpoint to fetch the Courseware Discussion Sidebar waffle flag status.
Tests the endpoint to fetch the Courseware Discussion/Notifications Sidebar waffle flag status.
"""

def setUp(self):
Expand All @@ -3835,23 +3835,23 @@ def setUp(self):
self.course = CourseFactory.create()

self.client = APIClient()
self.apiUrl = reverse('discussion_sidebar_enabled_view', kwargs={'course_id': str(self.course.id)})
self.apiUrl = reverse('show_default_right_sidebar_enabled_view', kwargs={'course_id': str(self.course.id)})

@override_waffle_flag(COURSEWARE_MICROFRONTEND_DISCUSSION_SIDEBAR_OPEN_DISABLED, active=True)
def test_is_mfe_discussion_sidebar_opening_disabled(self):
@override_waffle_flag(COURSEWARE_SHOW_DEFAULT_RIGHT_SIDEBAR, active=False)
def test_is_mfe_show_default_right_sidebar_disabled(self):
"""
Getter to check if discussion sidebar shouldn't be opened by default.
Getter to check if right sidebar shouldn't be opened by default.
"""
response = self.client.get(self.apiUrl, content_type='application/json')
body = json.loads(response.content.decode('utf-8'))

self.assertEqual(response.status_code, 200)
self.assertEqual(body, {'enabled': False})

@override_waffle_flag(COURSEWARE_MICROFRONTEND_DISCUSSION_SIDEBAR_OPEN_DISABLED, active=False)
def test_is_mfe_discussion_sidebar_opening_enabled(self):
@override_waffle_flag(COURSEWARE_SHOW_DEFAULT_RIGHT_SIDEBAR, active=True)
def test_is_mfe_show_default_right_sidebar_enabled(self):
"""
Getter to check if discussion sidebar should be opened by default.
Getter to check if right sidebar should be opened by default.
"""
response = self.client.get(self.apiUrl, content_type='application/json')
body = json.loads(response.content.decode('utf-8'))
Expand Down

0 comments on commit fe52fa6

Please sign in to comment.