Commit 54d34e83 by Sanford Student

update all references to instructor module

parent 83011e1c
......@@ -39,8 +39,8 @@ from django.core.urlresolvers import reverse
from bulk_email.models import CourseEmail, Optout
from courseware.courses import get_course
from openedx.core.lib.courses import course_image_url
from instructor_task.models import InstructorTask
from instructor_task.subtasks import (
from lms.djangoapps.instructor_task.models import InstructorTask
from lms.djangoapps.instructor_task.subtasks import (
SubtaskStatus,
queue_subtasks_for_query,
check_subtask_is_valid,
......
......@@ -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.cohorts import add_user_to_cohort
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.models import CourseEnrollment
from student.tests.factories import CourseEnrollmentFactory, UserFactory
......
......@@ -16,8 +16,8 @@ from smtplib import SMTPDataError, SMTPServerDisconnected, SMTPConnectError
from bulk_email.models import CourseEmail, SEND_TO_MYSELF, BulkEmailFlag
from bulk_email.tasks import perform_delegate_email_batches, send_course_email
from instructor_task.models import InstructorTask
from instructor_task.subtasks import (
from lms.djangoapps.instructor_task.models import InstructorTask
from lms.djangoapps.instructor_task.subtasks import (
initialize_subtask_info,
SubtaskStatus,
check_subtask_is_valid,
......@@ -344,7 +344,7 @@ class TestEmailErrors(ModuleStoreTestCase):
bogus_email_id = 1001
to_list = ['test@test.com']
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
with self.assertRaises(DatabaseError):
send_course_email(entry_id, bogus_email_id, to_list, global_email_context, subtask_status.to_dict())
......
......@@ -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.tasks import _get_course_email_context
from instructor_task.tasks import send_bulk_course_email
from instructor_task.subtasks import update_subtask_status, SubtaskStatus
from instructor_task.models import InstructorTask
from instructor_task.tests.test_base import InstructorTaskCourseTestCase
from instructor_task.tests.factories import InstructorTaskFactory
from lms.djangoapps.instructor_task.tasks import send_bulk_course_email
from lms.djangoapps.instructor_task.subtasks import update_subtask_status, SubtaskStatus
from lms.djangoapps.instructor_task.models import InstructorTask
from lms.djangoapps.instructor_task.tests.test_base import InstructorTaskCourseTestCase
from lms.djangoapps.instructor_task.tests.factories import InstructorTaskFactory
from opaque_keys.edx.locations import SlashSeparatedCourseKey
......
......@@ -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_meta import completion_check, course_group_check
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 openedx.core.djangoapps.xmodule_django.models import CourseKeyField, NoneToEmptyManager
......
......@@ -24,7 +24,7 @@ from certificates.tests.factories import (
CertificateInvalidationFactory,
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 student.tests.factories import AdminFactory, UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
......
......@@ -22,7 +22,7 @@ from django.utils.translation import ugettext as _
from certificates import api
from certificates.models import CertificateInvalidation
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.edx.keys import CourseKey
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
......
......@@ -8,7 +8,7 @@ from util.date_utils import get_default_time_display
from bulk_email.models import CourseEmail
from django.utils.translation import ugettext as _
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__)
......
......@@ -13,8 +13,8 @@ from celery.states import READY_STATES
from xmodule.modulestore.django import modulestore
from instructor_task.models import InstructorTask
from instructor_task.tasks import (
from lms.djangoapps.instructor_task.models import InstructorTask
from lms.djangoapps.instructor_task.tasks import (
rescore_problem,
reset_problem_attempts,
delete_problem_state,
......@@ -35,7 +35,7 @@ from instructor_task.tasks import (
from certificates.models import CertificateGenerationHistory
from instructor_task.api_helper import (
from lms.djangoapps.instructor_task.api_helper import (
check_arguments_for_rescoring,
encode_problem_and_student_input,
encode_entrance_exam_and_student_input,
......
......@@ -19,7 +19,7 @@ from courseware.courses import get_problems_in_section
from xmodule.modulestore.django import modulestore
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__)
......
......@@ -14,7 +14,7 @@ import dogstats_wrapper as dog_stats_api
from django.db import transaction, DatabaseError
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
TASK_LOG = logging.getLogger('edx.celery.task')
......
......@@ -27,7 +27,7 @@ from django.utils.translation import ugettext_noop
from celery import task
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,
BaseInstructorTask,
perform_module_state_update,
......
......@@ -58,7 +58,7 @@ from instructor_analytics.basic import (
)
from instructor_analytics.csvs import format_dictlist
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 openedx.core.djangoapps.course_groups.cohorts import get_cohort
from openedx.core.djangoapps.course_groups.models import CourseUserGroup
......
......@@ -3,7 +3,7 @@ import json
import factory
from factory.django import DjangoModelFactory
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 opaque_keys.edx.locations import SlashSeparatedCourseKey
......
......@@ -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 xmodule.modulestore.exceptions import ItemNotFoundError
from instructor_task.api import (
from lms.djangoapps.instructor_task.api import (
get_running_instructor_tasks,
get_instructor_task_history,
submit_rescore_problem_for_all_students,
......@@ -28,10 +28,10 @@ from instructor_task.api import (
SpecificStudentIdMissingError,
)
from instructor_task.api_helper import AlreadyRunningError
from instructor_task.models import InstructorTask, PROGRESS
from instructor_task.tasks import export_ora2_data
from instructor_task.tests.test_base import (
from lms.djangoapps.instructor_task.api_helper import AlreadyRunningError
from lms.djangoapps.instructor_task.models import InstructorTask, PROGRESS
from lms.djangoapps.instructor_task.tasks import export_ora2_data
from lms.djangoapps.instructor_task.tests.test_base import (
InstructorTaskTestCase,
InstructorTaskCourseTestCase,
InstructorTaskModuleTestCase,
......@@ -273,7 +273,7 @@ class InstructorTaskCourseSubmitTest(TestReportMixin, InstructorTaskCourseTestCa
def test_submit_ora2_request_task(self):
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()
submit_export_ora2_data(request, self.course.id)
......
......@@ -26,10 +26,10 @@ from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from instructor_task.api_helper import encode_problem_and_student_input
from instructor_task.models import PROGRESS, QUEUING, ReportStore
from instructor_task.tests.factories import InstructorTaskFactory
from instructor_task.views import instructor_task_status
from lms.djangoapps.instructor_task.api_helper import encode_problem_and_student_input
from lms.djangoapps.instructor_task.models import PROGRESS, QUEUING, ReportStore
from lms.djangoapps.instructor_task.tests.factories import InstructorTaskFactory
from lms.djangoapps.instructor_task.views import instructor_task_status
TEST_COURSE_ORG = 'edx'
......
......@@ -25,13 +25,15 @@ from xmodule.modulestore import ModuleStoreEnum
from courseware.model_data import StudentModule
from instructor_task.api import (submit_rescore_problem_for_all_students,
submit_rescore_problem_for_student,
submit_reset_problem_attempts_for_all_students,
submit_delete_problem_state_for_all_students)
from instructor_task.models import InstructorTask
from instructor_task.tasks_helper import upload_grades_csv
from instructor_task.tests.test_base import (
from lms.djangoapps.instructor_task.api import (
submit_rescore_problem_for_all_students,
submit_rescore_problem_for_student,
submit_reset_problem_attempts_for_all_students,
submit_delete_problem_state_for_all_students
)
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,
TestReportMixin,
OPTION_1,
......@@ -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_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')
self.verify_csv_task_success(result)
self.verify_grades_in_csv(
......@@ -594,7 +596,7 @@ class TestGradeReportConditionalContent(TestReportMixin, TestConditionalContent,
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')
self.verify_csv_task_success(result)
self.verify_grades_in_csv(
......
......@@ -11,8 +11,8 @@ from django.test import SimpleTestCase, override_settings, TestCase
from mock import patch
from common.test.utils import MockS3Mixin
from instructor_task.models import ReportStore
from instructor_task.tests.test_base import TestReportMixin
from lms.djangoapps.instructor_task.models import ReportStore
from lms.djangoapps.instructor_task.tests.test_base import TestReportMixin
from opaque_keys.edx.locator import CourseLocator
......
......@@ -7,9 +7,9 @@ from mock import Mock, patch
from student.models import CourseEnrollment
from instructor_task.subtasks import queue_subtasks_for_query
from instructor_task.tests.factories import InstructorTaskFactory
from instructor_task.tests.test_base import InstructorTaskCourseTestCase
from lms.djangoapps.instructor_task.subtasks import queue_subtasks_for_query
from lms.djangoapps.instructor_task.tests.factories import InstructorTaskFactory
from lms.djangoapps.instructor_task.tests.test_base import InstructorTaskCourseTestCase
class TestSubtasks(InstructorTaskCourseTestCase):
......@@ -45,7 +45,7 @@ class TestSubtasks(InstructorTaskCourseTestCase):
self._enroll_students_in_course(self.course.id, extra_count)
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
queue_subtasks_for_query(
entry=instructor_task,
......
......@@ -22,17 +22,17 @@ from courseware.models import StudentModule
from courseware.tests.factories import StudentModuleFactory
from student.tests.factories import UserFactory, CourseEnrollmentFactory
from instructor_task.models import InstructorTask
from instructor_task.tests.test_base import InstructorTaskModuleTestCase
from instructor_task.tests.factories import InstructorTaskFactory
from instructor_task.tasks import (
from lms.djangoapps.instructor_task.models import InstructorTask
from lms.djangoapps.instructor_task.tests.test_base import InstructorTaskModuleTestCase
from lms.djangoapps.instructor_task.tests.factories import InstructorTaskFactory
from lms.djangoapps.instructor_task.tasks import (
rescore_problem,
reset_problem_attempts,
delete_problem_state,
generate_certificates,
export_ora2_data,
)
from instructor_task.tasks_helper import (
from lms.djangoapps.instructor_task.tasks_helper import (
UpdateProblemModuleStateError,
upload_ora2_data,
)
......@@ -87,7 +87,7 @@ class TestInstructorTasks(InstructorTaskModuleTestCase):
self.current_task.update_state.side_effect = TestTaskFailure(expected_failure_message)
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
return task_class.apply(task_args, task_id=task_id).get()
......@@ -246,7 +246,7 @@ class TestRescoreInstructorTask(TestInstructorTasks):
task_entry = self._create_input_entry()
mock_instance = MagicMock()
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
with self.assertRaises(UpdateProblemModuleStateError):
self._run_task_with_mock_celery(rescore_problem, task_entry.id, task_entry.task_id)
......@@ -264,7 +264,7 @@ class TestRescoreInstructorTask(TestInstructorTasks):
task_entry = self._create_input_entry()
mock_instance = Mock()
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
self._run_task_with_mock_celery(rescore_problem, task_entry.id, task_entry.task_id)
# check return value
......@@ -284,7 +284,7 @@ class TestRescoreInstructorTask(TestInstructorTasks):
task_entry = self._create_input_entry()
mock_instance = Mock()
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
self._run_task_with_mock_celery(rescore_problem, task_entry.id, task_entry.task_id)
# check return value
......@@ -304,7 +304,7 @@ class TestRescoreInstructorTask(TestInstructorTasks):
task_entry = self._create_input_entry()
mock_instance = Mock()
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
self._run_task_with_mock_celery(rescore_problem, task_entry.id, task_entry.task_id)
# check return value
......@@ -502,7 +502,7 @@ class TestOra2ResponsesInstructorTask(TestInstructorTasks):
task_entry = self._create_input_entry()
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)
action_name = ugettext_noop('generated')
......
......@@ -9,11 +9,13 @@ from mock import Mock, patch
from django.http import QueryDict
from instructor_task.models import PROGRESS
from instructor_task.tests.test_base import (InstructorTaskTestCase,
TEST_FAILURE_MESSAGE,
TEST_FAILURE_EXCEPTION)
from instructor_task.views import instructor_task_status, get_task_completion_info
from lms.djangoapps.instructor_task.models import PROGRESS
from lms.djangoapps.instructor_task.tests.test_base import (
InstructorTaskTestCase,
TEST_FAILURE_MESSAGE,
TEST_FAILURE_EXCEPTION
)
from lms.djangoapps.instructor_task.views import instructor_task_status, get_task_completion_info
class InstructorTaskReportTest(InstructorTaskTestCase):
......
......@@ -7,9 +7,8 @@ from django.utils.translation import ugettext as _
from celery.states import FAILURE, REVOKED, READY_STATES
from instructor_task.api_helper import (get_status_from_instructor_task,
get_updated_instructor_task)
from instructor_task.models import PROGRESS
from lms.djangoapps.instructor_task.api_helper import (get_status_from_instructor_task, get_updated_instructor_task)
from lms.djangoapps.instructor_task.models import PROGRESS
log = logging.getLogger(__name__)
......
......@@ -35,7 +35,7 @@ LOG_OVERRIDES = [
('codejail.safe_exec', logging.ERROR),
('edx.courseware', 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:
......
......@@ -1925,7 +1925,7 @@ INSTALLED_APPS = (
'certificates',
'dashboard',
'lms.djangoapps.instructor',
'instructor_task',
'lms.djangoapps.instructor_task',
'openedx.core.djangoapps.course_groups',
'bulk_email',
'branding',
......
......@@ -877,7 +877,7 @@ if settings.FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS'):
urlpatterns += (
url(
r'^instructor_task_status/$',
'instructor_task.views.instructor_task_status',
'lms.djangoapps.instructor_task.views.instructor_task_status',
name='instructor_task_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