Commit 85d0a45b by Ned Batchelder

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.
parent 6e8d075d
...@@ -25,6 +25,7 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase): ...@@ -25,6 +25,7 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase):
""" """
Set up tests Set up tests
""" """
super(TestInstructorDashboard, self).setUp()
self.course = CourseFactory.create() self.course = CourseFactory.create()
self.course_mode = CourseMode(course_id=self.course.id, self.course_mode = CourseMode(course_id=self.course.id,
...@@ -76,7 +77,7 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase): ...@@ -76,7 +77,7 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase):
CourseFinanceAdminRole(self.course.id).add_users(self.instructor) CourseFinanceAdminRole(self.course.id).add_users(self.instructor)
total_amount = PaidCourseRegistration.get_total_amount_of_purchased_item(self.course.id) total_amount = PaidCourseRegistration.get_total_amount_of_purchased_item(self.course.id)
response = self.client.get(self.url) 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}) @patch.dict(settings.FEATURES, {'DISPLAY_ANALYTICS_ENROLLMENTS': False})
@override_settings(ANALYTICS_DASHBOARD_URL='') @override_settings(ANALYTICS_DASHBOARD_URL='')
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<h2>${_("Sales")}</h2> <h2>${_("Sales")}</h2>
<div> <div>
%if section_data['total_amount'] is not None: %if section_data['total_amount'] is not None:
<span><strong>${_("Total Credit Card Purchases: ")}</strong></span><span>$${section_data['total_amount']}</span> <span><strong>${_("Total Credit Card Purchases: ")}</strong></span><span>${section_data['currency_symbol']}${section_data['total_amount']}</span>
%endif %endif
<span class="csv_tip"> <span class="csv_tip">
<div> <div>
......
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