From 85d0a45b143f2b62b6470960b3d49f4e317eca03 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 16 Mar 2015 15:32:17 -0400 Subject: [PATCH] Fix test_instructor_dashboard.py tests This file was never run, because of a missing __init__.py. It needs a super() call to make the ModuleStoreTestCase work properly. Then one test failed, because of a missed change from dollar to configurable currency. --- lms/djangoapps/instructor/tests/views/__init__.py | 0 .../instructor/tests/views/test_instructor_dashboard.py | 3 ++- .../instructor/instructor_dashboard_2/e-commerce.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 lms/djangoapps/instructor/tests/views/__init__.py diff --git a/lms/djangoapps/instructor/tests/views/__init__.py b/lms/djangoapps/instructor/tests/views/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py b/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py index 545a7b6c28..6c76acd51a 100644 --- a/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py +++ b/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py @@ -25,6 +25,7 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase): """ Set up tests """ + super(TestInstructorDashboard, self).setUp() self.course = CourseFactory.create() self.course_mode = CourseMode(course_id=self.course.id, @@ -76,7 +77,7 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase): CourseFinanceAdminRole(self.course.id).add_users(self.instructor) total_amount = PaidCourseRegistration.get_total_amount_of_purchased_item(self.course.id) response = self.client.get(self.url) - self.assertTrue('{currency}{amount}'.format(currency='Rs', amount=total_amount) in response.content) + self.assertIn('{currency}{amount}'.format(currency='Rs', amount=total_amount), response.content) @patch.dict(settings.FEATURES, {'DISPLAY_ANALYTICS_ENROLLMENTS': False}) @override_settings(ANALYTICS_DASHBOARD_URL='') diff --git a/lms/templates/instructor/instructor_dashboard_2/e-commerce.html b/lms/templates/instructor/instructor_dashboard_2/e-commerce.html index 291b363bc7..7efdd538c7 100644 --- a/lms/templates/instructor/instructor_dashboard_2/e-commerce.html +++ b/lms/templates/instructor/instructor_dashboard_2/e-commerce.html @@ -64,7 +64,7 @@

${_("Sales")}

%if section_data['total_amount'] is not None: - ${_("Total Credit Card Purchases: ")}$${section_data['total_amount']} + ${_("Total Credit Card Purchases: ")}${section_data['currency_symbol']}${section_data['total_amount']} %endif