Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
54d34e83
Commit
54d34e83
authored
Oct 06, 2016
by
Sanford Student
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update all references to instructor module
parent
83011e1c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
73 additions
and
70 deletions
+73
-70
lms/djangoapps/bulk_email/tasks.py
+2
-2
lms/djangoapps/bulk_email/tests/test_email.py
+1
-1
lms/djangoapps/bulk_email/tests/test_err_handling.py
+3
-3
lms/djangoapps/bulk_email/tests/test_tasks.py
+5
-5
lms/djangoapps/certificates/models.py
+1
-1
lms/djangoapps/certificates/tests/test_models.py
+1
-1
lms/djangoapps/certificates/views/support.py
+1
-1
lms/djangoapps/instructor/tests/test_api.py
+0
-0
lms/djangoapps/instructor/views/api.py
+0
-0
lms/djangoapps/instructor/views/instructor_task_helpers.py
+1
-1
lms/djangoapps/instructor_task/api.py
+3
-3
lms/djangoapps/instructor_task/api_helper.py
+1
-1
lms/djangoapps/instructor_task/subtasks.py
+1
-1
lms/djangoapps/instructor_task/tasks.py
+1
-1
lms/djangoapps/instructor_task/tasks_helper.py
+1
-1
lms/djangoapps/instructor_task/tests/factories.py
+1
-1
lms/djangoapps/instructor_task/tests/test_api.py
+6
-6
lms/djangoapps/instructor_task/tests/test_base.py
+4
-4
lms/djangoapps/instructor_task/tests/test_integration.py
+11
-9
lms/djangoapps/instructor_task/tests/test_models.py
+2
-2
lms/djangoapps/instructor_task/tests/test_subtasks.py
+4
-4
lms/djangoapps/instructor_task/tests/test_tasks.py
+11
-11
lms/djangoapps/instructor_task/tests/test_tasks_helper.py
+0
-0
lms/djangoapps/instructor_task/tests/test_views.py
+7
-5
lms/djangoapps/instructor_task/views.py
+2
-3
lms/envs/acceptance.py
+1
-1
lms/envs/common.py
+1
-1
lms/urls.py
+1
-1
No files found.
lms/djangoapps/bulk_email/tasks.py
View file @
54d34e83
...
@@ -39,8 +39,8 @@ from django.core.urlresolvers import reverse
...
@@ -39,8 +39,8 @@ from django.core.urlresolvers import reverse
from
bulk_email.models
import
CourseEmail
,
Optout
from
bulk_email.models
import
CourseEmail
,
Optout
from
courseware.courses
import
get_course
from
courseware.courses
import
get_course
from
openedx.core.lib.courses
import
course_image_url
from
openedx.core.lib.courses
import
course_image_url
from
instructor_task.models
import
InstructorTask
from
lms.djangoapps.
instructor_task.models
import
InstructorTask
from
instructor_task.subtasks
import
(
from
lms.djangoapps.
instructor_task.subtasks
import
(
SubtaskStatus
,
SubtaskStatus
,
queue_subtasks_for_query
,
queue_subtasks_for_query
,
check_subtask_is_valid
,
check_subtask_is_valid
,
...
...
lms/djangoapps/bulk_email/tests/test_email.py
View file @
54d34e83
...
@@ -21,7 +21,7 @@ from bulk_email.tasks import _get_source_address, _get_course_email_context
...
@@ -21,7 +21,7 @@ from bulk_email.tasks import _get_source_address, _get_course_email_context
from
openedx.core.djangoapps.course_groups.models
import
CourseCohort
from
openedx.core.djangoapps.course_groups.models
import
CourseCohort
from
openedx.core.djangoapps.course_groups.cohorts
import
add_user_to_cohort
from
openedx.core.djangoapps.course_groups.cohorts
import
add_user_to_cohort
from
courseware.tests.factories
import
StaffFactory
,
InstructorFactory
from
courseware.tests.factories
import
StaffFactory
,
InstructorFactory
from
instructor_task.subtasks
import
update_subtask_status
from
lms.djangoapps.
instructor_task.subtasks
import
update_subtask_status
from
student.roles
import
CourseStaffRole
from
student.roles
import
CourseStaffRole
from
student.models
import
CourseEnrollment
from
student.models
import
CourseEnrollment
from
student.tests.factories
import
CourseEnrollmentFactory
,
UserFactory
from
student.tests.factories
import
CourseEnrollmentFactory
,
UserFactory
...
...
lms/djangoapps/bulk_email/tests/test_err_handling.py
View file @
54d34e83
...
@@ -16,8 +16,8 @@ from smtplib import SMTPDataError, SMTPServerDisconnected, SMTPConnectError
...
@@ -16,8 +16,8 @@ from smtplib import SMTPDataError, SMTPServerDisconnected, SMTPConnectError
from
bulk_email.models
import
CourseEmail
,
SEND_TO_MYSELF
,
BulkEmailFlag
from
bulk_email.models
import
CourseEmail
,
SEND_TO_MYSELF
,
BulkEmailFlag
from
bulk_email.tasks
import
perform_delegate_email_batches
,
send_course_email
from
bulk_email.tasks
import
perform_delegate_email_batches
,
send_course_email
from
instructor_task.models
import
InstructorTask
from
lms.djangoapps.
instructor_task.models
import
InstructorTask
from
instructor_task.subtasks
import
(
from
lms.djangoapps.
instructor_task.subtasks
import
(
initialize_subtask_info
,
initialize_subtask_info
,
SubtaskStatus
,
SubtaskStatus
,
check_subtask_is_valid
,
check_subtask_is_valid
,
...
@@ -344,7 +344,7 @@ class TestEmailErrors(ModuleStoreTestCase):
...
@@ -344,7 +344,7 @@ class TestEmailErrors(ModuleStoreTestCase):
bogus_email_id
=
1001
bogus_email_id
=
1001
to_list
=
[
'test@test.com'
]
to_list
=
[
'test@test.com'
]
global_email_context
=
{
'course_title'
:
'dummy course'
}
global_email_context
=
{
'course_title'
:
'dummy course'
}
with
patch
(
'instructor_task.subtasks.InstructorTask.save'
)
as
mock_task_save
:
with
patch
(
'
lms.djangoapps.
instructor_task.subtasks.InstructorTask.save'
)
as
mock_task_save
:
mock_task_save
.
side_effect
=
DatabaseError
mock_task_save
.
side_effect
=
DatabaseError
with
self
.
assertRaises
(
DatabaseError
):
with
self
.
assertRaises
(
DatabaseError
):
send_course_email
(
entry_id
,
bogus_email_id
,
to_list
,
global_email_context
,
subtask_status
.
to_dict
())
send_course_email
(
entry_id
,
bogus_email_id
,
to_list
,
global_email_context
,
subtask_status
.
to_dict
())
...
...
lms/djangoapps/bulk_email/tests/test_tasks.py
View file @
54d34e83
...
@@ -35,11 +35,11 @@ from xmodule.modulestore.tests.factories import CourseFactory
...
@@ -35,11 +35,11 @@ from xmodule.modulestore.tests.factories import CourseFactory
from
bulk_email.models
import
CourseEmail
,
Optout
,
SEND_TO_MYSELF
,
SEND_TO_STAFF
,
SEND_TO_LEARNERS
from
bulk_email.models
import
CourseEmail
,
Optout
,
SEND_TO_MYSELF
,
SEND_TO_STAFF
,
SEND_TO_LEARNERS
from
bulk_email.tasks
import
_get_course_email_context
from
bulk_email.tasks
import
_get_course_email_context
from
instructor_task.tasks
import
send_bulk_course_email
from
lms.djangoapps.
instructor_task.tasks
import
send_bulk_course_email
from
instructor_task.subtasks
import
update_subtask_status
,
SubtaskStatus
from
lms.djangoapps.
instructor_task.subtasks
import
update_subtask_status
,
SubtaskStatus
from
instructor_task.models
import
InstructorTask
from
lms.djangoapps.
instructor_task.models
import
InstructorTask
from
instructor_task.tests.test_base
import
InstructorTaskCourseTestCase
from
lms.djangoapps.
instructor_task.tests.test_base
import
InstructorTaskCourseTestCase
from
instructor_task.tests.factories
import
InstructorTaskFactory
from
lms.djangoapps.
instructor_task.tests.factories
import
InstructorTaskFactory
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
...
...
lms/djangoapps/certificates/models.py
View file @
54d34e83
...
@@ -66,7 +66,7 @@ from openedx.core.djangoapps.signals.signals import COURSE_CERT_AWARDED
...
@@ -66,7 +66,7 @@ from openedx.core.djangoapps.signals.signals import COURSE_CERT_AWARDED
from
badges.events.course_complete
import
course_badge_check
from
badges.events.course_complete
import
course_badge_check
from
badges.events.course_meta
import
completion_check
,
course_group_check
from
badges.events.course_meta
import
completion_check
,
course_group_check
from
config_models.models
import
ConfigurationModel
from
config_models.models
import
ConfigurationModel
from
instructor_task.models
import
InstructorTask
from
lms.djangoapps.
instructor_task.models
import
InstructorTask
from
util.milestones_helpers
import
fulfill_course_milestone
,
is_prerequisite_courses_enabled
from
util.milestones_helpers
import
fulfill_course_milestone
,
is_prerequisite_courses_enabled
from
openedx.core.djangoapps.xmodule_django.models
import
CourseKeyField
,
NoneToEmptyManager
from
openedx.core.djangoapps.xmodule_django.models
import
CourseKeyField
,
NoneToEmptyManager
...
...
lms/djangoapps/certificates/tests/test_models.py
View file @
54d34e83
...
@@ -24,7 +24,7 @@ from certificates.tests.factories import (
...
@@ -24,7 +24,7 @@ from certificates.tests.factories import (
CertificateInvalidationFactory
,
CertificateInvalidationFactory
,
GeneratedCertificateFactory
GeneratedCertificateFactory
)
)
from
instructor_task.tests.factories
import
InstructorTaskFactory
from
lms.djangoapps.
instructor_task.tests.factories
import
InstructorTaskFactory
from
opaque_keys.edx.locator
import
CourseLocator
from
opaque_keys.edx.locator
import
CourseLocator
from
student.tests.factories
import
AdminFactory
,
UserFactory
from
student.tests.factories
import
AdminFactory
,
UserFactory
from
xmodule.modulestore.tests.django_utils
import
SharedModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
SharedModuleStoreTestCase
...
...
lms/djangoapps/certificates/views/support.py
View file @
54d34e83
...
@@ -22,7 +22,7 @@ from django.utils.translation import ugettext as _
...
@@ -22,7 +22,7 @@ from django.utils.translation import ugettext as _
from
certificates
import
api
from
certificates
import
api
from
certificates.models
import
CertificateInvalidation
from
certificates.models
import
CertificateInvalidation
from
courseware.access
import
has_access
from
courseware.access
import
has_access
from
instructor_task.api
import
generate_certificates_for_students
from
lms.djangoapps.
instructor_task.api
import
generate_certificates_for_students
from
opaque_keys
import
InvalidKeyError
from
opaque_keys
import
InvalidKeyError
from
opaque_keys.edx.keys
import
CourseKey
from
opaque_keys.edx.keys
import
CourseKey
from
openedx.core.djangoapps.content.course_overviews.models
import
CourseOverview
from
openedx.core.djangoapps.content.course_overviews.models
import
CourseOverview
...
...
lms/djangoapps/instructor/tests/test_api.py
View file @
54d34e83
This diff is collapsed.
Click to expand it.
lms/djangoapps/instructor/views/api.py
View file @
54d34e83
This diff is collapsed.
Click to expand it.
lms/djangoapps/instructor/views/instructor_task_helpers.py
View file @
54d34e83
...
@@ -8,7 +8,7 @@ from util.date_utils import get_default_time_display
...
@@ -8,7 +8,7 @@ from util.date_utils import get_default_time_display
from
bulk_email.models
import
CourseEmail
from
bulk_email.models
import
CourseEmail
from
django.utils.translation
import
ugettext
as
_
from
django.utils.translation
import
ugettext
as
_
from
django.utils.translation
import
ungettext
from
django.utils.translation
import
ungettext
from
instructor_task.views
import
get_task_completion_info
from
lms.djangoapps.
instructor_task.views
import
get_task_completion_info
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
...
...
lms/djangoapps/instructor_task/api.py
View file @
54d34e83
...
@@ -13,8 +13,8 @@ from celery.states import READY_STATES
...
@@ -13,8 +13,8 @@ from celery.states import READY_STATES
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
modulestore
from
instructor_task.models
import
InstructorTask
from
lms.djangoapps.
instructor_task.models
import
InstructorTask
from
instructor_task.tasks
import
(
from
lms.djangoapps.
instructor_task.tasks
import
(
rescore_problem
,
rescore_problem
,
reset_problem_attempts
,
reset_problem_attempts
,
delete_problem_state
,
delete_problem_state
,
...
@@ -35,7 +35,7 @@ from instructor_task.tasks import (
...
@@ -35,7 +35,7 @@ from instructor_task.tasks import (
from
certificates.models
import
CertificateGenerationHistory
from
certificates.models
import
CertificateGenerationHistory
from
instructor_task.api_helper
import
(
from
lms.djangoapps.
instructor_task.api_helper
import
(
check_arguments_for_rescoring
,
check_arguments_for_rescoring
,
encode_problem_and_student_input
,
encode_problem_and_student_input
,
encode_entrance_exam_and_student_input
,
encode_entrance_exam_and_student_input
,
...
...
lms/djangoapps/instructor_task/api_helper.py
View file @
54d34e83
...
@@ -19,7 +19,7 @@ from courseware.courses import get_problems_in_section
...
@@ -19,7 +19,7 @@ from courseware.courses import get_problems_in_section
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
modulestore
from
opaque_keys.edx.keys
import
UsageKey
from
opaque_keys.edx.keys
import
UsageKey
from
instructor_task.models
import
InstructorTask
,
PROGRESS
from
lms.djangoapps.
instructor_task.models
import
InstructorTask
,
PROGRESS
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
...
...
lms/djangoapps/instructor_task/subtasks.py
View file @
54d34e83
...
@@ -14,7 +14,7 @@ import dogstats_wrapper as dog_stats_api
...
@@ -14,7 +14,7 @@ import dogstats_wrapper as dog_stats_api
from
django.db
import
transaction
,
DatabaseError
from
django.db
import
transaction
,
DatabaseError
from
django.core.cache
import
cache
from
django.core.cache
import
cache
from
instructor_task.models
import
InstructorTask
,
PROGRESS
,
QUEUING
from
lms.djangoapps.
instructor_task.models
import
InstructorTask
,
PROGRESS
,
QUEUING
from
util.db
import
outer_atomic
from
util.db
import
outer_atomic
TASK_LOG
=
logging
.
getLogger
(
'edx.celery.task'
)
TASK_LOG
=
logging
.
getLogger
(
'edx.celery.task'
)
...
...
lms/djangoapps/instructor_task/tasks.py
View file @
54d34e83
...
@@ -27,7 +27,7 @@ from django.utils.translation import ugettext_noop
...
@@ -27,7 +27,7 @@ from django.utils.translation import ugettext_noop
from
celery
import
task
from
celery
import
task
from
bulk_email.tasks
import
perform_delegate_email_batches
from
bulk_email.tasks
import
perform_delegate_email_batches
from
instructor_task.tasks_helper
import
(
from
lms.djangoapps.
instructor_task.tasks_helper
import
(
run_main_task
,
run_main_task
,
BaseInstructorTask
,
BaseInstructorTask
,
perform_module_state_update
,
perform_module_state_update
,
...
...
lms/djangoapps/instructor_task/tasks_helper.py
View file @
54d34e83
...
@@ -58,7 +58,7 @@ from instructor_analytics.basic import (
...
@@ -58,7 +58,7 @@ from instructor_analytics.basic import (
)
)
from
instructor_analytics.csvs
import
format_dictlist
from
instructor_analytics.csvs
import
format_dictlist
from
openassessment.data
import
OraAggregateData
from
openassessment.data
import
OraAggregateData
from
instructor_task.models
import
ReportStore
,
InstructorTask
,
PROGRESS
from
lms.djangoapps.
instructor_task.models
import
ReportStore
,
InstructorTask
,
PROGRESS
from
lms.djangoapps.lms_xblock.runtime
import
LmsPartitionService
from
lms.djangoapps.lms_xblock.runtime
import
LmsPartitionService
from
openedx.core.djangoapps.course_groups.cohorts
import
get_cohort
from
openedx.core.djangoapps.course_groups.cohorts
import
get_cohort
from
openedx.core.djangoapps.course_groups.models
import
CourseUserGroup
from
openedx.core.djangoapps.course_groups.models
import
CourseUserGroup
...
...
lms/djangoapps/instructor_task/tests/factories.py
View file @
54d34e83
...
@@ -3,7 +3,7 @@ import json
...
@@ -3,7 +3,7 @@ import json
import
factory
import
factory
from
factory.django
import
DjangoModelFactory
from
factory.django
import
DjangoModelFactory
from
student.tests.factories
import
UserFactory
as
StudentUserFactory
from
student.tests.factories
import
UserFactory
as
StudentUserFactory
from
instructor_task.models
import
InstructorTask
from
lms.djangoapps.
instructor_task.models
import
InstructorTask
from
celery.states
import
PENDING
from
celery.states
import
PENDING
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
...
...
lms/djangoapps/instructor_task/tests/test_api.py
View file @
54d34e83
...
@@ -7,7 +7,7 @@ from bulk_email.models import CourseEmail, SEND_TO_MYSELF, SEND_TO_STAFF, SEND_T
...
@@ -7,7 +7,7 @@ from bulk_email.models import CourseEmail, SEND_TO_MYSELF, SEND_TO_STAFF, SEND_T
from
courseware.tests.factories
import
UserFactory
from
courseware.tests.factories
import
UserFactory
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
from
instructor_task.api
import
(
from
lms.djangoapps.
instructor_task.api
import
(
get_running_instructor_tasks
,
get_running_instructor_tasks
,
get_instructor_task_history
,
get_instructor_task_history
,
submit_rescore_problem_for_all_students
,
submit_rescore_problem_for_all_students
,
...
@@ -28,10 +28,10 @@ from instructor_task.api import (
...
@@ -28,10 +28,10 @@ from instructor_task.api import (
SpecificStudentIdMissingError
,
SpecificStudentIdMissingError
,
)
)
from
instructor_task.api_helper
import
AlreadyRunningError
from
lms.djangoapps.
instructor_task.api_helper
import
AlreadyRunningError
from
instructor_task.models
import
InstructorTask
,
PROGRESS
from
lms.djangoapps.
instructor_task.models
import
InstructorTask
,
PROGRESS
from
instructor_task.tasks
import
export_ora2_data
from
lms.djangoapps.
instructor_task.tasks
import
export_ora2_data
from
instructor_task.tests.test_base
import
(
from
lms.djangoapps.
instructor_task.tests.test_base
import
(
InstructorTaskTestCase
,
InstructorTaskTestCase
,
InstructorTaskCourseTestCase
,
InstructorTaskCourseTestCase
,
InstructorTaskModuleTestCase
,
InstructorTaskModuleTestCase
,
...
@@ -273,7 +273,7 @@ class InstructorTaskCourseSubmitTest(TestReportMixin, InstructorTaskCourseTestCa
...
@@ -273,7 +273,7 @@ class InstructorTaskCourseSubmitTest(TestReportMixin, InstructorTaskCourseTestCa
def
test_submit_ora2_request_task
(
self
):
def
test_submit_ora2_request_task
(
self
):
request
=
self
.
create_task_request
(
self
.
instructor
)
request
=
self
.
create_task_request
(
self
.
instructor
)
with
patch
(
'instructor_task.api.submit_task'
)
as
mock_submit_task
:
with
patch
(
'
lms.djangoapps.
instructor_task.api.submit_task'
)
as
mock_submit_task
:
mock_submit_task
.
return_value
=
MagicMock
()
mock_submit_task
.
return_value
=
MagicMock
()
submit_export_ora2_data
(
request
,
self
.
course
.
id
)
submit_export_ora2_data
(
request
,
self
.
course
.
id
)
...
...
lms/djangoapps/instructor_task/tests/test_base.py
View file @
54d34e83
...
@@ -26,10 +26,10 @@ from xmodule.modulestore.django import modulestore
...
@@ -26,10 +26,10 @@ from xmodule.modulestore.django import modulestore
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
instructor_task.api_helper
import
encode_problem_and_student_input
from
lms.djangoapps.
instructor_task.api_helper
import
encode_problem_and_student_input
from
instructor_task.models
import
PROGRESS
,
QUEUING
,
ReportStore
from
lms.djangoapps.
instructor_task.models
import
PROGRESS
,
QUEUING
,
ReportStore
from
instructor_task.tests.factories
import
InstructorTaskFactory
from
lms.djangoapps.
instructor_task.tests.factories
import
InstructorTaskFactory
from
instructor_task.views
import
instructor_task_status
from
lms.djangoapps.
instructor_task.views
import
instructor_task_status
TEST_COURSE_ORG
=
'edx'
TEST_COURSE_ORG
=
'edx'
...
...
lms/djangoapps/instructor_task/tests/test_integration.py
View file @
54d34e83
...
@@ -25,13 +25,15 @@ from xmodule.modulestore import ModuleStoreEnum
...
@@ -25,13 +25,15 @@ from xmodule.modulestore import ModuleStoreEnum
from
courseware.model_data
import
StudentModule
from
courseware.model_data
import
StudentModule
from
instructor_task.api
import
(
submit_rescore_problem_for_all_students
,
from
lms.djangoapps.instructor_task.api
import
(
submit_rescore_problem_for_student
,
submit_rescore_problem_for_all_students
,
submit_reset_problem_attempts_for_all_students
,
submit_rescore_problem_for_student
,
submit_delete_problem_state_for_all_students
)
submit_reset_problem_attempts_for_all_students
,
from
instructor_task.models
import
InstructorTask
submit_delete_problem_state_for_all_students
from
instructor_task.tasks_helper
import
upload_grades_csv
)
from
instructor_task.tests.test_base
import
(
from
lms.djangoapps.instructor_task.models
import
InstructorTask
from
lms.djangoapps.instructor_task.tasks_helper
import
upload_grades_csv
from
lms.djangoapps.instructor_task.tests.test_base
import
(
InstructorTaskModuleTestCase
,
InstructorTaskModuleTestCase
,
TestReportMixin
,
TestReportMixin
,
OPTION_1
,
OPTION_1
,
...
@@ -571,7 +573,7 @@ class TestGradeReportConditionalContent(TestReportMixin, TestConditionalContent,
...
@@ -571,7 +573,7 @@ class TestGradeReportConditionalContent(TestReportMixin, TestConditionalContent,
self
.
submit_student_answer
(
self
.
student_a
.
username
,
problem_a_url
,
[
OPTION_1
,
OPTION_1
])
self
.
submit_student_answer
(
self
.
student_a
.
username
,
problem_a_url
,
[
OPTION_1
,
OPTION_1
])
self
.
submit_student_answer
(
self
.
student_b
.
username
,
problem_b_url
,
[
OPTION_1
,
OPTION_2
])
self
.
submit_student_answer
(
self
.
student_b
.
username
,
problem_b_url
,
[
OPTION_1
,
OPTION_2
])
with
patch
(
'instructor_task.tasks_helper._get_current_task'
):
with
patch
(
'
lms.djangoapps.
instructor_task.tasks_helper._get_current_task'
):
result
=
upload_grades_csv
(
None
,
None
,
self
.
course
.
id
,
None
,
'graded'
)
result
=
upload_grades_csv
(
None
,
None
,
self
.
course
.
id
,
None
,
'graded'
)
self
.
verify_csv_task_success
(
result
)
self
.
verify_csv_task_success
(
result
)
self
.
verify_grades_in_csv
(
self
.
verify_grades_in_csv
(
...
@@ -594,7 +596,7 @@ class TestGradeReportConditionalContent(TestReportMixin, TestConditionalContent,
...
@@ -594,7 +596,7 @@ class TestGradeReportConditionalContent(TestReportMixin, TestConditionalContent,
self
.
submit_student_answer
(
self
.
student_a
.
username
,
problem_a_url
,
[
OPTION_1
,
OPTION_1
])
self
.
submit_student_answer
(
self
.
student_a
.
username
,
problem_a_url
,
[
OPTION_1
,
OPTION_1
])
with
patch
(
'instructor_task.tasks_helper._get_current_task'
):
with
patch
(
'
lms.djangoapps.
instructor_task.tasks_helper._get_current_task'
):
result
=
upload_grades_csv
(
None
,
None
,
self
.
course
.
id
,
None
,
'graded'
)
result
=
upload_grades_csv
(
None
,
None
,
self
.
course
.
id
,
None
,
'graded'
)
self
.
verify_csv_task_success
(
result
)
self
.
verify_csv_task_success
(
result
)
self
.
verify_grades_in_csv
(
self
.
verify_grades_in_csv
(
...
...
lms/djangoapps/instructor_task/tests/test_models.py
View file @
54d34e83
...
@@ -11,8 +11,8 @@ from django.test import SimpleTestCase, override_settings, TestCase
...
@@ -11,8 +11,8 @@ from django.test import SimpleTestCase, override_settings, TestCase
from
mock
import
patch
from
mock
import
patch
from
common.test.utils
import
MockS3Mixin
from
common.test.utils
import
MockS3Mixin
from
instructor_task.models
import
ReportStore
from
lms.djangoapps.
instructor_task.models
import
ReportStore
from
instructor_task.tests.test_base
import
TestReportMixin
from
lms.djangoapps.
instructor_task.tests.test_base
import
TestReportMixin
from
opaque_keys.edx.locator
import
CourseLocator
from
opaque_keys.edx.locator
import
CourseLocator
...
...
lms/djangoapps/instructor_task/tests/test_subtasks.py
View file @
54d34e83
...
@@ -7,9 +7,9 @@ from mock import Mock, patch
...
@@ -7,9 +7,9 @@ from mock import Mock, patch
from
student.models
import
CourseEnrollment
from
student.models
import
CourseEnrollment
from
instructor_task.subtasks
import
queue_subtasks_for_query
from
lms.djangoapps.
instructor_task.subtasks
import
queue_subtasks_for_query
from
instructor_task.tests.factories
import
InstructorTaskFactory
from
lms.djangoapps.
instructor_task.tests.factories
import
InstructorTaskFactory
from
instructor_task.tests.test_base
import
InstructorTaskCourseTestCase
from
lms.djangoapps.
instructor_task.tests.test_base
import
InstructorTaskCourseTestCase
class
TestSubtasks
(
InstructorTaskCourseTestCase
):
class
TestSubtasks
(
InstructorTaskCourseTestCase
):
...
@@ -45,7 +45,7 @@ class TestSubtasks(InstructorTaskCourseTestCase):
...
@@ -45,7 +45,7 @@ class TestSubtasks(InstructorTaskCourseTestCase):
self
.
_enroll_students_in_course
(
self
.
course
.
id
,
extra_count
)
self
.
_enroll_students_in_course
(
self
.
course
.
id
,
extra_count
)
return
{}
return
{}
with
patch
(
'instructor_task.subtasks.initialize_subtask_info'
)
as
mock_initialize_subtask_info
:
with
patch
(
'
lms.djangoapps.
instructor_task.subtasks.initialize_subtask_info'
)
as
mock_initialize_subtask_info
:
mock_initialize_subtask_info
.
side_effect
=
initialize_subtask_info
mock_initialize_subtask_info
.
side_effect
=
initialize_subtask_info
queue_subtasks_for_query
(
queue_subtasks_for_query
(
entry
=
instructor_task
,
entry
=
instructor_task
,
...
...
lms/djangoapps/instructor_task/tests/test_tasks.py
View file @
54d34e83
...
@@ -22,17 +22,17 @@ from courseware.models import StudentModule
...
@@ -22,17 +22,17 @@ from courseware.models import StudentModule
from
courseware.tests.factories
import
StudentModuleFactory
from
courseware.tests.factories
import
StudentModuleFactory
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
from
instructor_task.models
import
InstructorTask
from
lms.djangoapps.
instructor_task.models
import
InstructorTask
from
instructor_task.tests.test_base
import
InstructorTaskModuleTestCase
from
lms.djangoapps.
instructor_task.tests.test_base
import
InstructorTaskModuleTestCase
from
instructor_task.tests.factories
import
InstructorTaskFactory
from
lms.djangoapps.
instructor_task.tests.factories
import
InstructorTaskFactory
from
instructor_task.tasks
import
(
from
lms.djangoapps.
instructor_task.tasks
import
(
rescore_problem
,
rescore_problem
,
reset_problem_attempts
,
reset_problem_attempts
,
delete_problem_state
,
delete_problem_state
,
generate_certificates
,
generate_certificates
,
export_ora2_data
,
export_ora2_data
,
)
)
from
instructor_task.tasks_helper
import
(
from
lms.djangoapps.
instructor_task.tasks_helper
import
(
UpdateProblemModuleStateError
,
UpdateProblemModuleStateError
,
upload_ora2_data
,
upload_ora2_data
,
)
)
...
@@ -87,7 +87,7 @@ class TestInstructorTasks(InstructorTaskModuleTestCase):
...
@@ -87,7 +87,7 @@ class TestInstructorTasks(InstructorTaskModuleTestCase):
self
.
current_task
.
update_state
.
side_effect
=
TestTaskFailure
(
expected_failure_message
)
self
.
current_task
.
update_state
.
side_effect
=
TestTaskFailure
(
expected_failure_message
)
task_args
=
[
entry_id
,
self
.
_get_xmodule_instance_args
()]
task_args
=
[
entry_id
,
self
.
_get_xmodule_instance_args
()]
with
patch
(
'instructor_task.tasks_helper._get_current_task'
)
as
mock_get_task
:
with
patch
(
'
lms.djangoapps.
instructor_task.tasks_helper._get_current_task'
)
as
mock_get_task
:
mock_get_task
.
return_value
=
self
.
current_task
mock_get_task
.
return_value
=
self
.
current_task
return
task_class
.
apply
(
task_args
,
task_id
=
task_id
)
.
get
()
return
task_class
.
apply
(
task_args
,
task_id
=
task_id
)
.
get
()
...
@@ -246,7 +246,7 @@ class TestRescoreInstructorTask(TestInstructorTasks):
...
@@ -246,7 +246,7 @@ class TestRescoreInstructorTask(TestInstructorTasks):
task_entry
=
self
.
_create_input_entry
()
task_entry
=
self
.
_create_input_entry
()
mock_instance
=
MagicMock
()
mock_instance
=
MagicMock
()
del
mock_instance
.
rescore_problem
del
mock_instance
.
rescore_problem
with
patch
(
'instructor_task.tasks_helper.get_module_for_descriptor_internal'
)
as
mock_get_module
:
with
patch
(
'
lms.djangoapps.
instructor_task.tasks_helper.get_module_for_descriptor_internal'
)
as
mock_get_module
:
mock_get_module
.
return_value
=
mock_instance
mock_get_module
.
return_value
=
mock_instance
with
self
.
assertRaises
(
UpdateProblemModuleStateError
):
with
self
.
assertRaises
(
UpdateProblemModuleStateError
):
self
.
_run_task_with_mock_celery
(
rescore_problem
,
task_entry
.
id
,
task_entry
.
task_id
)
self
.
_run_task_with_mock_celery
(
rescore_problem
,
task_entry
.
id
,
task_entry
.
task_id
)
...
@@ -264,7 +264,7 @@ class TestRescoreInstructorTask(TestInstructorTasks):
...
@@ -264,7 +264,7 @@ class TestRescoreInstructorTask(TestInstructorTasks):
task_entry
=
self
.
_create_input_entry
()
task_entry
=
self
.
_create_input_entry
()
mock_instance
=
Mock
()
mock_instance
=
Mock
()
mock_instance
.
rescore_problem
=
Mock
(
return_value
=
{
'success'
:
'correct'
})
mock_instance
.
rescore_problem
=
Mock
(
return_value
=
{
'success'
:
'correct'
})
with
patch
(
'instructor_task.tasks_helper.get_module_for_descriptor_internal'
)
as
mock_get_module
:
with
patch
(
'
lms.djangoapps.
instructor_task.tasks_helper.get_module_for_descriptor_internal'
)
as
mock_get_module
:
mock_get_module
.
return_value
=
mock_instance
mock_get_module
.
return_value
=
mock_instance
self
.
_run_task_with_mock_celery
(
rescore_problem
,
task_entry
.
id
,
task_entry
.
task_id
)
self
.
_run_task_with_mock_celery
(
rescore_problem
,
task_entry
.
id
,
task_entry
.
task_id
)
# check return value
# check return value
...
@@ -284,7 +284,7 @@ class TestRescoreInstructorTask(TestInstructorTasks):
...
@@ -284,7 +284,7 @@ class TestRescoreInstructorTask(TestInstructorTasks):
task_entry
=
self
.
_create_input_entry
()
task_entry
=
self
.
_create_input_entry
()
mock_instance
=
Mock
()
mock_instance
=
Mock
()
mock_instance
.
rescore_problem
=
Mock
(
return_value
=
{
'success'
:
'bogus'
})
mock_instance
.
rescore_problem
=
Mock
(
return_value
=
{
'success'
:
'bogus'
})
with
patch
(
'instructor_task.tasks_helper.get_module_for_descriptor_internal'
)
as
mock_get_module
:
with
patch
(
'
lms.djangoapps.
instructor_task.tasks_helper.get_module_for_descriptor_internal'
)
as
mock_get_module
:
mock_get_module
.
return_value
=
mock_instance
mock_get_module
.
return_value
=
mock_instance
self
.
_run_task_with_mock_celery
(
rescore_problem
,
task_entry
.
id
,
task_entry
.
task_id
)
self
.
_run_task_with_mock_celery
(
rescore_problem
,
task_entry
.
id
,
task_entry
.
task_id
)
# check return value
# check return value
...
@@ -304,7 +304,7 @@ class TestRescoreInstructorTask(TestInstructorTasks):
...
@@ -304,7 +304,7 @@ class TestRescoreInstructorTask(TestInstructorTasks):
task_entry
=
self
.
_create_input_entry
()
task_entry
=
self
.
_create_input_entry
()
mock_instance
=
Mock
()
mock_instance
=
Mock
()
mock_instance
.
rescore_problem
=
Mock
(
return_value
=
{
'bogus'
:
'value'
})
mock_instance
.
rescore_problem
=
Mock
(
return_value
=
{
'bogus'
:
'value'
})
with
patch
(
'instructor_task.tasks_helper.get_module_for_descriptor_internal'
)
as
mock_get_module
:
with
patch
(
'
lms.djangoapps.
instructor_task.tasks_helper.get_module_for_descriptor_internal'
)
as
mock_get_module
:
mock_get_module
.
return_value
=
mock_instance
mock_get_module
.
return_value
=
mock_instance
self
.
_run_task_with_mock_celery
(
rescore_problem
,
task_entry
.
id
,
task_entry
.
task_id
)
self
.
_run_task_with_mock_celery
(
rescore_problem
,
task_entry
.
id
,
task_entry
.
task_id
)
# check return value
# check return value
...
@@ -502,7 +502,7 @@ class TestOra2ResponsesInstructorTask(TestInstructorTasks):
...
@@ -502,7 +502,7 @@ class TestOra2ResponsesInstructorTask(TestInstructorTasks):
task_entry
=
self
.
_create_input_entry
()
task_entry
=
self
.
_create_input_entry
()
task_xmodule_args
=
self
.
_get_xmodule_instance_args
()
task_xmodule_args
=
self
.
_get_xmodule_instance_args
()
with
patch
(
'instructor_task.tasks.run_main_task'
)
as
mock_main_task
:
with
patch
(
'
lms.djangoapps.
instructor_task.tasks.run_main_task'
)
as
mock_main_task
:
export_ora2_data
(
task_entry
.
id
,
task_xmodule_args
)
export_ora2_data
(
task_entry
.
id
,
task_xmodule_args
)
action_name
=
ugettext_noop
(
'generated'
)
action_name
=
ugettext_noop
(
'generated'
)
...
...
lms/djangoapps/instructor_task/tests/test_tasks_helper.py
View file @
54d34e83
This diff is collapsed.
Click to expand it.
lms/djangoapps/instructor_task/tests/test_views.py
View file @
54d34e83
...
@@ -9,11 +9,13 @@ from mock import Mock, patch
...
@@ -9,11 +9,13 @@ from mock import Mock, patch
from
django.http
import
QueryDict
from
django.http
import
QueryDict
from
instructor_task.models
import
PROGRESS
from
lms.djangoapps.instructor_task.models
import
PROGRESS
from
instructor_task.tests.test_base
import
(
InstructorTaskTestCase
,
from
lms.djangoapps.instructor_task.tests.test_base
import
(
TEST_FAILURE_MESSAGE
,
InstructorTaskTestCase
,
TEST_FAILURE_EXCEPTION
)
TEST_FAILURE_MESSAGE
,
from
instructor_task.views
import
instructor_task_status
,
get_task_completion_info
TEST_FAILURE_EXCEPTION
)
from
lms.djangoapps.instructor_task.views
import
instructor_task_status
,
get_task_completion_info
class
InstructorTaskReportTest
(
InstructorTaskTestCase
):
class
InstructorTaskReportTest
(
InstructorTaskTestCase
):
...
...
lms/djangoapps/instructor_task/views.py
View file @
54d34e83
...
@@ -7,9 +7,8 @@ from django.utils.translation import ugettext as _
...
@@ -7,9 +7,8 @@ from django.utils.translation import ugettext as _
from
celery.states
import
FAILURE
,
REVOKED
,
READY_STATES
from
celery.states
import
FAILURE
,
REVOKED
,
READY_STATES
from
instructor_task.api_helper
import
(
get_status_from_instructor_task
,
from
lms.djangoapps.instructor_task.api_helper
import
(
get_status_from_instructor_task
,
get_updated_instructor_task
)
get_updated_instructor_task
)
from
lms.djangoapps.instructor_task.models
import
PROGRESS
from
instructor_task.models
import
PROGRESS
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
...
...
lms/envs/acceptance.py
View file @
54d34e83
...
@@ -35,7 +35,7 @@ LOG_OVERRIDES = [
...
@@ -35,7 +35,7 @@ LOG_OVERRIDES = [
(
'codejail.safe_exec'
,
logging
.
ERROR
),
(
'codejail.safe_exec'
,
logging
.
ERROR
),
(
'edx.courseware'
,
logging
.
ERROR
),
(
'edx.courseware'
,
logging
.
ERROR
),
(
'audit'
,
logging
.
ERROR
),
(
'audit'
,
logging
.
ERROR
),
(
'instructor_task.api_helper'
,
logging
.
ERROR
),
(
'
lms.djangoapps.
instructor_task.api_helper'
,
logging
.
ERROR
),
]
]
for
log_name
,
log_level
in
LOG_OVERRIDES
:
for
log_name
,
log_level
in
LOG_OVERRIDES
:
...
...
lms/envs/common.py
View file @
54d34e83
...
@@ -1925,7 +1925,7 @@ INSTALLED_APPS = (
...
@@ -1925,7 +1925,7 @@ INSTALLED_APPS = (
'certificates'
,
'certificates'
,
'dashboard'
,
'dashboard'
,
'lms.djangoapps.instructor'
,
'lms.djangoapps.instructor'
,
'instructor_task'
,
'
lms.djangoapps.
instructor_task'
,
'openedx.core.djangoapps.course_groups'
,
'openedx.core.djangoapps.course_groups'
,
'bulk_email'
,
'bulk_email'
,
'branding'
,
'branding'
,
...
...
lms/urls.py
View file @
54d34e83
...
@@ -877,7 +877,7 @@ if settings.FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS'):
...
@@ -877,7 +877,7 @@ if settings.FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS'):
urlpatterns
+=
(
urlpatterns
+=
(
url
(
url
(
r'^instructor_task_status/$'
,
r'^instructor_task_status/$'
,
'instructor_task.views.instructor_task_status'
,
'
lms.djangoapps.
instructor_task.views.instructor_task_status'
,
name
=
'instructor_task_status'
name
=
'instructor_task_status'
),
),
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment