From d3e051ce2973b05698e906ded8a2660779b10199 Mon Sep 17 00:00:00 2001 From: Dennis Jen Date: Thu, 6 Nov 2014 13:42:00 -0500 Subject: [PATCH] fixed quaility errors in instructor_dashboard.py, moved test_instructor_dashboard under tests/views directory --- .../tests/{ => views}/test_instructor_dashboard.py | 6 ++++++ lms/djangoapps/instructor/views/instructor_dashboard.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) rename lms/djangoapps/instructor/tests/{ => views}/test_instructor_dashboard.py (96%) diff --git a/lms/djangoapps/instructor/tests/test_instructor_dashboard.py b/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py similarity index 96% rename from lms/djangoapps/instructor/tests/test_instructor_dashboard.py rename to lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py index 957c577433..535676a320 100644 --- a/lms/djangoapps/instructor/tests/test_instructor_dashboard.py +++ b/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py @@ -38,10 +38,16 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase): patch.stopall() def get_dashboard_enrollment_message(self): + """ + Returns expected dashboard enrollment message with link to Insights. + """ return 'Enrollment data is now available in Example.'.format(unicode(self.course.id)) def get_dashboard_demographic_message(self): + """ + Returns expected dashboard demographic message with link to Insights. + """ return 'Demographic data is now available in Example.'.format(unicode(self.course.id)) diff --git a/lms/djangoapps/instructor/views/instructor_dashboard.py b/lms/djangoapps/instructor/views/instructor_dashboard.py index 585b2fffb6..8495e0c5de 100644 --- a/lms/djangoapps/instructor/views/instructor_dashboard.py +++ b/lms/djangoapps/instructor/views/instructor_dashboard.py @@ -275,7 +275,7 @@ def _is_small_course(course_key): def _section_student_admin(course, access): """ Provide data for the corresponding dashboard section """ course_key = course.id - is_small_course =_is_small_course(course_key) + is_small_course = _is_small_course(course_key) section_data = { 'section_key': 'student_admin', @@ -364,7 +364,7 @@ def _section_send_email(course, access): def _get_dashboard_link(course_key): - # Construct a URL to the external analytics dashboard + """ Construct a URL to the external analytics dashboard """ analytics_dashboard_url = '{0}/courses/{1}'.format(settings.ANALYTICS_DASHBOARD_URL, unicode(course_key)) link = "{1}".format(analytics_dashboard_url, settings.ANALYTICS_DASHBOARD_NAME)