Commit d3e051ce by Dennis Jen

fixed quaility errors in instructor_dashboard.py, moved…

fixed quaility errors in instructor_dashboard.py, moved test_instructor_dashboard under tests/views directory
parent 66b3e382
...@@ -38,10 +38,16 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase): ...@@ -38,10 +38,16 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase):
patch.stopall() patch.stopall()
def get_dashboard_enrollment_message(self): def get_dashboard_enrollment_message(self):
"""
Returns expected dashboard enrollment message with link to Insights.
"""
return 'Enrollment data is now available in <a href="http://example.com/courses/{}" ' \ return 'Enrollment data is now available in <a href="http://example.com/courses/{}" ' \
'target="_blank">Example</a>.'.format(unicode(self.course.id)) 'target="_blank">Example</a>.'.format(unicode(self.course.id))
def get_dashboard_demographic_message(self): def get_dashboard_demographic_message(self):
"""
Returns expected dashboard demographic message with link to Insights.
"""
return 'Demographic data is now available in <a href="http://example.com/courses/{}" ' \ return 'Demographic data is now available in <a href="http://example.com/courses/{}" ' \
'target="_blank">Example</a>.'.format(unicode(self.course.id)) 'target="_blank">Example</a>.'.format(unicode(self.course.id))
......
...@@ -275,7 +275,7 @@ def _is_small_course(course_key): ...@@ -275,7 +275,7 @@ def _is_small_course(course_key):
def _section_student_admin(course, access): def _section_student_admin(course, access):
""" Provide data for the corresponding dashboard section """ """ Provide data for the corresponding dashboard section """
course_key = course.id course_key = course.id
is_small_course =_is_small_course(course_key) is_small_course = _is_small_course(course_key)
section_data = { section_data = {
'section_key': 'student_admin', 'section_key': 'student_admin',
...@@ -364,7 +364,7 @@ def _section_send_email(course, access): ...@@ -364,7 +364,7 @@ def _section_send_email(course, access):
def _get_dashboard_link(course_key): 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)) analytics_dashboard_url = '{0}/courses/{1}'.format(settings.ANALYTICS_DASHBOARD_URL, unicode(course_key))
link = "<a href=\"{0}\" target=\"_blank\">{1}</a>".format(analytics_dashboard_url, link = "<a href=\"{0}\" target=\"_blank\">{1}</a>".format(analytics_dashboard_url,
settings.ANALYTICS_DASHBOARD_NAME) settings.ANALYTICS_DASHBOARD_NAME)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment