diff --git a/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py b/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py index b073b8019f..b104dc095f 100644 --- a/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py +++ b/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py @@ -20,6 +20,7 @@ from courseware.tests.factories import StaffFactory, StudentModuleFactory, UserF from courseware.tests.helpers import LoginEnrollmentTestCase from edxmako.shortcuts import render_to_response from lms.djangoapps.instructor.views.gradebook_api import calculate_page_info +from pyquery import PyQuery as pq from shoppingcart.models import CourseRegCodeItem, Order, PaidCourseRegistration from student.models import CourseEnrollment from student.roles import CourseFinanceAdminRole @@ -66,6 +67,12 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase, XssT mode_display_name=CourseMode.DEFAULT_MODE.name, min_price=40 ) + self.course_info = CourseFactory.create( + org="ACME", + number="001", + run="2017", + name="How to defeat the Road Runner" + ) self.course_mode.save() # Create instructor account self.instructor = AdminFactory.create() @@ -107,6 +114,44 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase, XssT student = UserFactory.create() self.assertFalse(has_instructor_tab(student, self.course)) + @ddt.data( + ("How to defeat the Road Runner", "2017", "001", "ACME"), + ) + @ddt.unpack + def test_instructor_course_info(self, display_name, run, number, org): + """ + Verify that it shows the correct course information + """ + url = reverse( + 'instructor_dashboard', + kwargs={ + 'course_id': unicode(self.course_info.id) + } + ) + + response = self.client.get(url) + content = pq(response.content) + + self.assertEqual( + display_name, + content('#field-course-display-name b').contents()[0].strip() + ) + + self.assertEqual( + run, + content('#field-course-name b').contents()[0].strip() + ) + + self.assertEqual( + number, + content('#field-course-number b').contents()[0].strip() + ) + + self.assertEqual( + org, + content('#field-course-organization b').contents()[0].strip() + ) + def test_student_admin_staff_instructor(self): """ Verify that staff users are not able to see course-wide options, while still diff --git a/lms/djangoapps/instructor/views/instructor_dashboard.py b/lms/djangoapps/instructor/views/instructor_dashboard.py index ea9fc15c30..1b5e531e80 100644 --- a/lms/djangoapps/instructor/views/instructor_dashboard.py +++ b/lms/djangoapps/instructor/views/instructor_dashboard.py @@ -441,7 +441,9 @@ def _section_course_info(course, access): 'section_display_name': _('Course Info'), 'access': access, 'course_id': course_key, - 'course_display_name': course.display_name, + 'course_display_name': course.display_name_with_default, + 'course_org': course.display_org_with_default, + 'course_number': course.display_number_with_default, 'has_started': course.has_started(), 'has_ended': course.has_ended(), 'start_date': course.start, diff --git a/lms/templates/instructor/instructor_dashboard_2/course_info.html b/lms/templates/instructor/instructor_dashboard_2/course_info.html index bed2cb916e..35f3aecabc 100644 --- a/lms/templates/instructor/instructor_dashboard_2/course_info.html +++ b/lms/templates/instructor/instructor_dashboard_2/course_info.html @@ -44,24 +44,24 @@ from openedx.core.djangolib.markup import HTML, Text

${_("Basic Course Information")}