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