Added unit test for subdirectory Gradebook MFE deploy

This commit is contained in:
spokerman12
2021-01-22 09:31:07 -04:00
parent f53f5df505
commit 8259b82c63

View File

@@ -330,7 +330,8 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase, XssT
)
def test_staff_can_see_writable_gradebook(self):
"""
Test that, when the writable gradebook featue is enabled, a staff member can see it.
Test that, when the writable gradebook feature is enabled and
deployed in another domain, a staff member can see it.
"""
waffle_flag = waffle_flags()[WRITABLE_GRADEBOOK]
with override_waffle_flag(waffle_flag, active=True):
@@ -345,6 +346,28 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase, XssT
'of enrolled learners.'
)
@patch(
'lms.djangoapps.instructor.views.instructor_dashboard.settings.WRITABLE_GRADEBOOK_URL',
settings.LMS_ROOT_URL + '/gradebook'
)
def test_staff_can_see_writable_gradebook_as_subdirectory(self):
"""
Test that, when the writable gradebook feature is enabled and
deployed in a subdirectory, a staff member can see it.
"""
waffle_flag = waffle_flags()[WRITABLE_GRADEBOOK]
with override_waffle_flag(waffle_flag, active=True):
response = self.client.get(self.url)
expected_gradebook_url = '{}/{}'.format(settings.WRITABLE_GRADEBOOK_URL, self.course.id)
self.assertContains(response, expected_gradebook_url)
self.assertContains(response, 'View Gradebook')
GRADEBOOK_LEARNER_COUNT_MESSAGE = (
'Note: This feature is available only to courses with a small number ' +
'of enrolled learners.'
)
def test_gradebook_learner_count_message(self):
"""
Test that, when the writable gradebook featue is NOT enabled, there IS