Commit 93e31e61 by srpearce

Merge pull request #8573 from edx/sylvia/docs/InstDashHousekeeping

Clean up some e-commerce strings on the Instructor Dashboard
parents a725e842 3ab45fba
...@@ -90,9 +90,9 @@ def click_a_button(step, button): # pylint: disable=unused-argument ...@@ -90,9 +90,9 @@ def click_a_button(step, button): # pylint: disable=unused-argument
world.css_click('input[name="calculate-grades-csv"]') world.css_click('input[name="calculate-grades-csv"]')
# Expect to see a message that grade report is being generated # Expect to see a message that grade report is being generated
expected_msg = "Your grade report is being generated!" \ expected_msg = "The grade report is being created." \
" You can view the status of the generation" \ " To view the status of the report, see" \
" task in the 'Pending Tasks' section." " Pending Instructor Tasks below."
world.wait_for_visible('#report-request-response') world.wait_for_visible('#report-request-response')
assert_in( assert_in(
expected_msg, world.css_text('#report-request-response'), expected_msg, world.css_text('#report-request-response'),
......
...@@ -85,7 +85,7 @@ REPORTS_DATA = ( ...@@ -85,7 +85,7 @@ REPORTS_DATA = (
'extra_instructor_api_kwargs': {} 'extra_instructor_api_kwargs': {}
}, },
{ {
'report_type': 'enrolled student profile', 'report_type': 'enrolled learner profile',
'instructor_api_endpoint': 'get_students_features', 'instructor_api_endpoint': 'get_students_features',
'task_api_endpoint': 'instructor_task.api.submit_calculate_students_features_csv', 'task_api_endpoint': 'instructor_task.api.submit_calculate_students_features_csv',
'extra_instructor_api_kwargs': {'csv': '/csv'} 'extra_instructor_api_kwargs': {'csv': '/csv'}
...@@ -97,7 +97,7 @@ REPORTS_DATA = ( ...@@ -97,7 +97,7 @@ REPORTS_DATA = (
'extra_instructor_api_kwargs': {} 'extra_instructor_api_kwargs': {}
}, },
{ {
'report_type': 'students who may enroll', 'report_type': 'enrollment',
'instructor_api_endpoint': 'get_students_who_may_enroll', 'instructor_api_endpoint': 'get_students_who_may_enroll',
'task_api_endpoint': 'instructor_task.api.submit_calculate_may_enroll_csv', 'task_api_endpoint': 'instructor_task.api.submit_calculate_may_enroll_csv',
'extra_instructor_api_kwargs': {}, 'extra_instructor_api_kwargs': {},
...@@ -2306,7 +2306,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa ...@@ -2306,7 +2306,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa
response = self.client.get(url, {}) response = self.client.get(url, {})
res_json = json.loads(response.content) res_json = json.loads(response.content)
self.assertIn('status', res_json) self.assertIn('status', res_json)
self.assertNotIn('already in progress', res_json['status']) self.assertNotIn('currently being created', res_json['status'])
# CSV generation already in progress: # CSV generation already in progress:
with patch('instructor_task.api.submit_calculate_may_enroll_csv') as submit_task_function: with patch('instructor_task.api.submit_calculate_may_enroll_csv') as submit_task_function:
error = AlreadyRunningError() error = AlreadyRunningError()
...@@ -2314,7 +2314,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa ...@@ -2314,7 +2314,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa
response = self.client.get(url, {}) response = self.client.get(url, {})
res_json = json.loads(response.content) res_json = json.loads(response.content)
self.assertIn('status', res_json) self.assertIn('status', res_json)
self.assertIn('already in progress', res_json['status']) self.assertIn('currently being created', res_json['status'])
def test_access_course_finance_admin_with_invalid_course_key(self): def test_access_course_finance_admin_with_invalid_course_key(self):
""" """
...@@ -2398,7 +2398,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa ...@@ -2398,7 +2398,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa
self.client.login(username=self.instructor.username, password='test') self.client.login(username=self.instructor.username, password='test')
url = reverse('get_enrollment_report', kwargs={'course_id': self.course.id.to_deprecated_string()}) url = reverse('get_enrollment_report', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {}) response = self.client.get(url, {})
self.assertIn('Your detailed enrollment report is being generated!', response.content) self.assertIn('The detailed enrollment report is being created.', response.content)
def test_bulk_purchase_detailed_report(self): def test_bulk_purchase_detailed_report(self):
""" """
...@@ -2448,7 +2448,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa ...@@ -2448,7 +2448,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa
url = reverse('get_enrollment_report', kwargs={'course_id': self.course.id.to_deprecated_string()}) url = reverse('get_enrollment_report', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {}) response = self.client.get(url, {})
self.assertIn('Your detailed enrollment report is being generated!', response.content) self.assertIn('The detailed enrollment report is being created.', response.content)
def test_create_registration_code_without_invoice_and_order(self): def test_create_registration_code_without_invoice_and_order(self):
""" """
...@@ -2470,7 +2470,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa ...@@ -2470,7 +2470,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa
url = reverse('get_enrollment_report', kwargs={'course_id': self.course.id.to_deprecated_string()}) url = reverse('get_enrollment_report', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {}) response = self.client.get(url, {})
self.assertIn('Your detailed enrollment report is being generated!', response.content) self.assertIn('The detailed enrollment report is being created.', response.content)
def test_invoice_payment_is_still_pending_for_registration_codes(self): def test_invoice_payment_is_still_pending_for_registration_codes(self):
""" """
...@@ -2495,7 +2495,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa ...@@ -2495,7 +2495,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa
url = reverse('get_enrollment_report', kwargs={'course_id': self.course.id.to_deprecated_string()}) url = reverse('get_enrollment_report', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {}) response = self.client.get(url, {})
self.assertIn('Your detailed enrollment report is being generated!', response.content) self.assertIn('The detailed enrollment report is being created.', response.content)
@patch.object(instructor.views.api, 'anonymous_id_for_user', Mock(return_value='42')) @patch.object(instructor.views.api, 'anonymous_id_for_user', Mock(return_value='42'))
@patch.object(instructor.views.api, 'unique_id_for_user', Mock(return_value='41')) @patch.object(instructor.views.api, 'unique_id_for_user', Mock(return_value='41'))
...@@ -2549,9 +2549,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa ...@@ -2549,9 +2549,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa
CourseFinanceAdminRole(self.course.id).add_users(self.instructor) CourseFinanceAdminRole(self.course.id).add_users(self.instructor)
with patch(task_api_endpoint): with patch(task_api_endpoint):
response = self.client.get(url, {}) response = self.client.get(url, {})
success_status = "Your {report_type} report is being generated!" \ success_status = "The {report_type} report is being created.".format(report_type=report_type)
" You can view the status of the generation task" \
" in the 'Pending Tasks' section.".format(report_type=report_type)
self.assertIn(success_status, response.content) self.assertIn(success_status, response.content)
@ddt.data(*EXECUTIVE_SUMMARY_DATA) @ddt.data(*EXECUTIVE_SUMMARY_DATA)
...@@ -2570,9 +2568,10 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa ...@@ -2570,9 +2568,10 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa
CourseFinanceAdminRole(self.course.id).add_users(self.instructor) CourseFinanceAdminRole(self.course.id).add_users(self.instructor)
with patch(task_api_endpoint): with patch(task_api_endpoint):
response = self.client.get(url, {}) response = self.client.get(url, {})
success_status = "Your {report_type} report is being created." \ success_status = "The {report_type} report is being created." \
" To view the status of the report, see the 'Pending Tasks'" \ " To view the status of the report, see Pending" \
" section.".format(report_type=report_type) " Instructor Tasks" \
" below".format(report_type=report_type)
self.assertIn(success_status, response.content) self.assertIn(success_status, response.content)
@ddt.data(*EXECUTIVE_SUMMARY_DATA) @ddt.data(*EXECUTIVE_SUMMARY_DATA)
...@@ -2592,11 +2591,11 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa ...@@ -2592,11 +2591,11 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa
with patch(task_api_endpoint) as mock: with patch(task_api_endpoint) as mock:
mock.side_effect = AlreadyRunningError() mock.side_effect = AlreadyRunningError()
response = self.client.get(url, {}) response = self.client.get(url, {})
already_running_status = "An {report_type} report is currently in progress." \ already_running_status = "The {report_type} report is currently being created." \
" To view the status of the report, see the 'Pending Tasks' section." \ " To view the status of the report, see Pending Instructor Tasks below." \
" When completed, the report will be available for download in the table below." \ " You will be able to download the report" \
" You will be able to download the" \ " when it is" \
" report when it is complete.".format(report_type=report_type) " complete.".format(report_type=report_type)
self.assertIn(already_running_status, response.content) self.assertIn(already_running_status, response.content)
def test_get_student_progress_url(self): def test_get_student_progress_url(self):
......
...@@ -1107,15 +1107,14 @@ def get_students_features(request, course_id, csv=False): # pylint: disable=red ...@@ -1107,15 +1107,14 @@ def get_students_features(request, course_id, csv=False): # pylint: disable=red
else: else:
try: try:
instructor_task.api.submit_calculate_students_features_csv(request, course_key, query_features) instructor_task.api.submit_calculate_students_features_csv(request, course_key, query_features)
success_status = _( success_status = _("The enrolled learner profile report is being created."
"Your enrolled student profile report is being generated! " " To view the status of the report, see Pending Instructor Tasks below.")
"You can view the status of the generation task in the 'Pending Tasks' section.")
return JsonResponse({"status": success_status}) return JsonResponse({"status": success_status})
except AlreadyRunningError: except AlreadyRunningError:
already_running_status = _( already_running_status = _(
"An enrolled student profile report generation task is already in progress. " "This enrollment report is currently being created."
"Check the 'Pending Tasks' table for the status of the task. When completed, " " To view the status of the report, see Pending Instructor Tasks below."
"the report will be available for download in the table below.") " You will be able to download the report when it is complete.")
return JsonResponse({"status": already_running_status}) return JsonResponse({"status": already_running_status})
...@@ -1136,15 +1135,16 @@ def get_students_who_may_enroll(request, course_id): ...@@ -1136,15 +1135,16 @@ def get_students_who_may_enroll(request, course_id):
try: try:
instructor_task.api.submit_calculate_may_enroll_csv(request, course_key, query_features) instructor_task.api.submit_calculate_may_enroll_csv(request, course_key, query_features)
success_status = _( success_status = _(
"Your students who may enroll report is being generated! " "The enrollment report is being created. This report contains"
"You can view the status of the generation task in the 'Pending Tasks' section." " information about learners who can enroll in the course."
" To view the status of the report, see Pending Instructor Tasks below."
) )
return JsonResponse({"status": success_status}) return JsonResponse({"status": success_status})
except AlreadyRunningError: except AlreadyRunningError:
already_running_status = _( already_running_status = _(
"A students who may enroll report generation task is already in progress. " "This enrollment report is currently being created."
"Check the 'Pending Tasks' table for the status of the task. " " To view the status of the report, see Pending Instructor Tasks below."
"When completed, the report will be available for download in the table below." " You will be able to download the report when it is complete."
) )
return JsonResponse({"status": already_running_status}) return JsonResponse({"status": already_running_status})
...@@ -1234,15 +1234,13 @@ def get_enrollment_report(request, course_id): ...@@ -1234,15 +1234,13 @@ def get_enrollment_report(request, course_id):
course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id) course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id)
try: try:
instructor_task.api.submit_detailed_enrollment_features_csv(request, course_key) instructor_task.api.submit_detailed_enrollment_features_csv(request, course_key)
success_status = _( success_status = _("The detailed enrollment report is being created."
"Your detailed enrollment report is being generated! " " To view the status of the report, see Pending Instructor Tasks below.")
"You can view the status of the generation task in the 'Pending Tasks' section.")
return JsonResponse({"status": success_status}) return JsonResponse({"status": success_status})
except AlreadyRunningError: except AlreadyRunningError:
already_running_status = _( already_running_status = _("The detailed enrollment report is being created."
"A detailed enrollment report generation task is already in progress. " " To view the status of the report, see Pending Instructor Tasks below."
"Check the 'Pending Tasks' table for the status of the task. " " You will be able to download the report when it is complete.")
"When completed, the report will be available for download in the table below.")
return JsonResponse({ return JsonResponse({
"status": already_running_status "status": already_running_status
}) })
...@@ -1259,15 +1257,13 @@ def get_exec_summary_report(request, course_id): ...@@ -1259,15 +1257,13 @@ def get_exec_summary_report(request, course_id):
course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id) course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id)
try: try:
instructor_task.api.submit_executive_summary_report(request, course_key) instructor_task.api.submit_executive_summary_report(request, course_key)
status_response = _( status_response = _("The executive summary report is being created."
"Your executive summary report is being created. " " To view the status of the report, see Pending Instructor Tasks below.")
"To view the status of the report, see the 'Pending Tasks' section.")
except AlreadyRunningError: except AlreadyRunningError:
status_response = _( status_response = _(
"An executive summary report is currently in progress. " "The executive summary report is currently being created."
"To view the status of the report, see the 'Pending Tasks' section. " " To view the status of the report, see Pending Instructor Tasks below."
"When completed, the report will be available for download in the table below. " " You will be able to download the report when it is complete."
"You will be able to download the report when it is complete."
) )
return JsonResponse({ return JsonResponse({
"status": status_response "status": status_response
...@@ -2091,15 +2087,13 @@ def calculate_grades_csv(request, course_id): ...@@ -2091,15 +2087,13 @@ def calculate_grades_csv(request, course_id):
course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id) course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id)
try: try:
instructor_task.api.submit_calculate_grades_csv(request, course_key) instructor_task.api.submit_calculate_grades_csv(request, course_key)
success_status = _( success_status = _("The grade report is being created."
"Your grade report is being generated! " " To view the status of the report, see Pending Instructor Tasks below.")
"You can view the status of the generation task in the 'Pending Tasks' section.")
return JsonResponse({"status": success_status}) return JsonResponse({"status": success_status})
except AlreadyRunningError: except AlreadyRunningError:
already_running_status = _( already_running_status = _("The grade report is currently being created."
"A grade report generation task is already in progress. " " To view the status of the report, see Pending Instructor Tasks below."
"Check the 'Pending Tasks' table for the status of the task. " " You will be able to download the report when it is complete.")
"When completed, the report will be available for download in the table below.")
return JsonResponse({ return JsonResponse({
"status": already_running_status "status": already_running_status
}) })
...@@ -2119,15 +2113,13 @@ def problem_grade_report(request, course_id): ...@@ -2119,15 +2113,13 @@ def problem_grade_report(request, course_id):
course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id) course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id)
try: try:
instructor_task.api.submit_problem_grade_report(request, course_key) instructor_task.api.submit_problem_grade_report(request, course_key)
success_status = _( success_status = _("The problem grade report is being created."
"Your problem grade report is being generated! " " To view the status of the report, see Pending Instructor Tasks below.")
"You can view the status of the generation task in the 'Pending Tasks' section.")
return JsonResponse({"status": success_status}) return JsonResponse({"status": success_status})
except AlreadyRunningError: except AlreadyRunningError:
already_running_status = _( already_running_status = _("A problem grade report is already being generated."
"A problem grade report is already being generated. " " To view the status of the report, see Pending Instructor Tasks below."
"Check the 'Pending Tasks' table for the status of the task. " " You will be able to download the report when it is complete.")
"When completed, the report will be available for download in the table below.")
return JsonResponse({ return JsonResponse({
"status": already_running_status "status": already_running_status
}) })
......
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