diff --git a/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py b/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py index c3bf7b07a6..7bd2d561b1 100644 --- a/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py +++ b/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py @@ -4,6 +4,7 @@ Unit tests for instructor_dashboard.py. import datetime +import re import ddt import six @@ -162,6 +163,27 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase, XssT else: self.assertNotContains(response, download_section) + @override_settings(ANALYTICS_DASHBOARD_URL='http://example.com') + @override_settings(ANALYTICS_DASHBOARD_NAME='Example') + def test_data_download_only(self): + """ + Verify that only the data download tab is visible for data researchers. + """ + user = UserFactory.create() + CourseAccessRoleFactory( + course_id=self.course.id, + user=user, + role='data_researcher', + org=self.course.id.org + ) + self.client.login(username=user.username, password="test") + response = self.client.get(self.url) + matches = re.findall( + rb'