Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ def test_student_admin_staff_instructor(self):
)
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):
Expand All @@ -345,6 +346,28 @@ def test_staff_can_see_writable_gradebook(self):
'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
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/instructor/views/instructor_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ def _section_student_admin(course, access):
'spoc_gradebook_url': reverse('spoc_gradebook', kwargs={'course_id': six.text_type(course_key)}),
}
if is_writable_gradebook_enabled(course_key) and settings.WRITABLE_GRADEBOOK_URL:
section_data['writable_gradebook_url'] = urljoin(settings.WRITABLE_GRADEBOOK_URL, '/' + text_type(course_key))
section_data['writable_gradebook_url'] = '{}/{}'.format(settings.WRITABLE_GRADEBOOK_URL, text_type(course_key))
return section_data


Expand Down