From 1664452a146f452918f3fb725aa9ae826d7db835 Mon Sep 17 00:00:00 2001 From: Julia Hansbrough Date: Wed, 15 Jan 2014 13:02:33 +0000 Subject: [PATCH] Final iteration --- .../shoppingcart/tests/test_reports.py | 2 +- .../shoppingcart/tests/test_views.py | 1 - lms/djangoapps/shoppingcart/views.py | 2 -- lms/envs/common.py | 2 +- .../shoppingcart/download_report.html | 22 +++++++++++-------- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/lms/djangoapps/shoppingcart/tests/test_reports.py b/lms/djangoapps/shoppingcart/tests/test_reports.py index 206aa393d2..d0dccd0acd 100644 --- a/lms/djangoapps/shoppingcart/tests/test_reports.py +++ b/lms/djangoapps/shoppingcart/tests/test_reports.py @@ -14,7 +14,7 @@ from django.test.utils import override_settings from course_modes.models import CourseMode from courseware.tests.tests import TEST_DATA_MONGO_MODULESTORE from shoppingcart.models import (Order, CertificateItem, PaidCourseRegistration, PaidCourseRegistrationAnnotation) -from shoppingcart.views import initialize_report, REPORT_TYPES +from shoppingcart.views import initialize_report from student.tests.factories import UserFactory from student.models import CourseEnrollment from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase diff --git a/lms/djangoapps/shoppingcart/tests/test_views.py b/lms/djangoapps/shoppingcart/tests/test_views.py index 519dfe90be..b18ebe6e8c 100644 --- a/lms/djangoapps/shoppingcart/tests/test_views.py +++ b/lms/djangoapps/shoppingcart/tests/test_views.py @@ -398,7 +398,6 @@ class CSVReportViewsTest(ModuleStoreTestCase): self.assertEqual(response['Content-Type'], 'text/csv') report = initialize_report(report_type, start_date, end_date, start_letter, end_letter) self.assertIn(",".join(report.header()), response.content) - # TODO add another test here class UtilFnsTest(TestCase): diff --git a/lms/djangoapps/shoppingcart/views.py b/lms/djangoapps/shoppingcart/views.py index 3dbf7d0378..fd1470588d 100644 --- a/lms/djangoapps/shoppingcart/views.py +++ b/lms/djangoapps/shoppingcart/views.py @@ -196,8 +196,6 @@ def csv_report(request): if not _can_download_report(request.user): return HttpResponseForbidden(_('You do not have permission to view this page.')) - # TODO temp filler for start letter, end letter - if request.method == 'POST': start_date = request.POST.get('start_date', '') end_date = request.POST.get('end_date', '') diff --git a/lms/envs/common.py b/lms/envs/common.py index d65e0715ad..39a7324da5 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -203,7 +203,7 @@ FEATURES = { # only edX superusers can perform the downloads) 'ALLOW_COURSE_STAFF_GRADE_DOWNLOADS': False, - 'ENABLED_PAYMENT_REPORTS': [ "refund_report", "itemized_purchase_report", "university_revenue_share", "certificate_status"], + 'ENABLED_PAYMENT_REPORTS': ["refund_report", "itemized_purchase_report", "university_revenue_share", "certificate_status"], } # Used for A/B testing diff --git a/lms/templates/shoppingcart/download_report.html b/lms/templates/shoppingcart/download_report.html index df618ff61b..584469f49d 100644 --- a/lms/templates/shoppingcart/download_report.html +++ b/lms/templates/shoppingcart/download_report.html @@ -14,6 +14,7 @@ % endif
+ %if ("itemized_purchase_report" or "refund_report") in settings.FEATURES['ENABLED_PAYMENT_REPORTS']:

${_("These reports are delimited by start and end dates.")}

@@ -22,17 +23,19 @@
%if "itemized_purchase_report" in settings.FEATURES['ENABLED_PAYMENT_REPORTS']: - -
+ +
%endif %if "refund_report" in settings.FEATURES['ENABLED_PAYMENT_REPORTS']: - -
+ +
%endif
- + %endif + + %if ("certificate_status" or "university_revenue_share") in settings.FEATURES['ENABLED_PAYMENT_REPORTS']:

${_("These reports are delimited alphabetically by university name. i.e., generating a report with 'Start Letter' A and 'End Letter' C will generate reports for all universities starting with A, B, and C.")}

@@ -42,13 +45,14 @@
%if "university_revenue_share" in settings.FEATURES['ENABLED_PAYMENT_REPORTS']: - -
+ +
%endif %if "certificate_status" in settings.FEATURES['ENABLED_PAYMENT_REPORTS']: - -
+ +
%endif + %endif