From eba951fe69e2edc16a22f6baacc265b9982b075e Mon Sep 17 00:00:00 2001 From: Jonathan Piacenti Date: Fri, 5 Jun 2015 15:59:11 -0500 Subject: [PATCH] Fix self-paced badge naming. --- lms/djangoapps/certificates/badge_handler.py | 2 +- lms/djangoapps/certificates/tests/test_badge_handler.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/certificates/badge_handler.py b/lms/djangoapps/certificates/badge_handler.py index 31eaf4ec27..706a8a499e 100644 --- a/lms/djangoapps/certificates/badge_handler.py +++ b/lms/djangoapps/certificates/badge_handler.py @@ -117,7 +117,7 @@ class BadgeHandler(object): ) else: return _(u'Completed the course "{course_name}" ({course_mode})').format( - start_date=course.display_name, + course_name=course.display_name, course_mode=mode, ) diff --git a/lms/djangoapps/certificates/tests/test_badge_handler.py b/lms/djangoapps/certificates/tests/test_badge_handler.py index 787bfb039f..35e5d46f29 100644 --- a/lms/djangoapps/certificates/tests/test_badge_handler.py +++ b/lms/djangoapps/certificates/tests/test_badge_handler.py @@ -115,6 +115,13 @@ class BadgeHandlerTestCase(ModuleStoreTestCase, EventTrackingTestCase): } ) + def test_self_paced_description(self): + """ + Verify that a badge created for a course with no end date gets a different description. + """ + self.course.end = None + self.assertEqual(BadgeHandler.badge_description(self.course, 'honor'), 'Completed the course "Badged" (honor)') + def test_ensure_badge_created_cache(self): """ Make sure ensure_badge_created doesn't call create_badge if we know the badge is already there.