From c6344aa5775be4263e48622907ce3ef64a609b1b Mon Sep 17 00:00:00 2001 From: "Dave St.Germain" Date: Thu, 14 May 2020 07:49:37 -0400 Subject: [PATCH] Only the data download tab should appear for data researchers TNL-7222 --- .../tests/views/test_instructor_dashboard.py | 22 +++++++++++++++++++ .../instructor/views/instructor_dashboard.py | 4 ++-- 2 files changed, 24 insertions(+), 2 deletions(-) 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'