File tree Expand file tree Collapse file tree
lms/djangoapps/courseware/tests
openedx/core/djangoapps/user_api/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717from common .djangoapps .student .tests .factories import GlobalStaffFactory
1818from lms .djangoapps .courseware .tests .helpers import LoginEnrollmentTestCase , set_preview_mode
1919from openedx .features .course_experience import DISABLE_COURSE_OUTLINE_PAGE_FLAG
20+ from openedx .features .course_experience .url_helpers import make_learning_mfe_courseware_url
2021
2122
2223@set_preview_mode (True )
@@ -111,7 +112,7 @@ def test_chrome_settings(self):
111112 assert ('course-navigation' in response .content .decode ('utf-8' )) == accordion
112113
113114 self .assertTabInactive ('progress' , response )
114- self .assertTabActive ('courseware' , response )
115+ self .assertTabActive (make_learning_mfe_courseware_url ( self . course . id ) , response )
115116
116117 response = self .client .get (reverse ('courseware_section' , kwargs = {
117118 'course_id' : str (self .course .id ),
@@ -120,7 +121,7 @@ def test_chrome_settings(self):
120121 }))
121122
122123 self .assertTabActive ('progress' , response )
123- self .assertTabInactive ('courseware' , response )
124+ self .assertTabInactive (make_learning_mfe_courseware_url ( self . course . id ) , response )
124125
125126 @override_settings (SESSION_INACTIVITY_TIMEOUT_IN_SECONDS = 1 )
126127 def test_inactive_session_timeout (self ):
Original file line number Diff line number Diff line change 55from django .http import HttpResponse
66from django .test import TestCase
77from django .test .client import RequestFactory
8+ from django .urls import reverse
89
910from common .djangoapps .student .tests .factories import AnonymousUserFactory , UserFactory
1011from openedx .core .djangolib .testing .utils import skip_unless_lms
@@ -29,9 +30,7 @@ def setUp(self):
2930 self .course_id = 'mock/course/id'
3031 self .request_factory = RequestFactory ()
3132
32- # TODO: Make it so we can use reverse. Appears to fail depending on the order in which tests are run
33- #self.request = RequestFactory().get(reverse('courseware', kwargs={'course_id': self.course_id}))
34- self .request = RequestFactory ().get (f'/courses/{ self .course_id } /courseware' )
33+ self .request = RequestFactory ().get (reverse ('progress' , kwargs = {'course_id' : self .course_id }))
3534 self .request .user = self .user
3635
3736 self .response = Mock (spec = HttpResponse )
You can’t perform that action at this time.
0 commit comments