From 3dc73c655b166da6c36bf74ef6a06014f2bd649e Mon Sep 17 00:00:00 2001 From: Mushtaq Ali Date: Mon, 29 Feb 2016 17:11:55 +0500 Subject: [PATCH] Display studio name properly on empty course page. --- .../contentstore/tests/test_course_listing.py | 10 ++++++++++ cms/templates/index.html | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cms/djangoapps/contentstore/tests/test_course_listing.py b/cms/djangoapps/contentstore/tests/test_course_listing.py index d0ea4f3422..4cd54eb356 100644 --- a/cms/djangoapps/contentstore/tests/test_course_listing.py +++ b/cms/djangoapps/contentstore/tests/test_course_listing.py @@ -8,6 +8,7 @@ from chrono import Timer from mock import patch, Mock import ddt +from django.conf import settings from django.test import RequestFactory from django.test.client import Client @@ -99,6 +100,15 @@ class TestCourseListing(ModuleStoreTestCase, XssTestMixin): self.assertEqual(response.status_code, 200) self.assert_no_xss(response, escaping_content) + def test_empty_course_listing(self): + """ + Test on empty course listing, studio name is properly displayed + """ + message = "Are you staff on an existing {studio_name} course?".format(studio_name=settings.STUDIO_SHORT_NAME) + response = self.client.get('/home') + self.assertEqual(response.status_code, 200) + self.assertIn(message, response.content) + def test_get_course_list(self): """ Test getting courses with new access group format e.g. 'instructor_edx.course.run' diff --git a/cms/templates/index.html b/cms/templates/index.html index ba72e4aa63..894bb9d7ed 100644 --- a/cms/templates/index.html +++ b/cms/templates/index.html @@ -346,7 +346,7 @@
-

${_("Are you staff on an existing {studio_name} course?").format(studio_name=set)}

+

${_("Are you staff on an existing {studio_name} course?").format(studio_name=settings.STUDIO_SHORT_NAME)}

${_('The course creator must give you access to the course. Contact the course creator or administrator for the course you are helping to author.')}