Merge pull request #5942 from edx/cohorted-courseware
Cohorted courseware
This commit is contained in:
@@ -12,7 +12,7 @@ from student.tests.factories import UserFactory, CourseEnrollmentFactory
|
||||
from xmodule.modulestore.tests.factories import ItemFactory, CourseFactory
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.partitions.partitions import Group, UserPartition
|
||||
from user_api.tests.factories import UserCourseTagFactory
|
||||
from openedx.core.djangoapps.user_api.tests.factories import UserCourseTagFactory
|
||||
|
||||
|
||||
@override_settings(MODULESTORE=TEST_DATA_MOCK_MODULESTORE)
|
||||
|
||||
@@ -27,7 +27,7 @@ from student.models import anonymous_id_for_user
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
from xmodule.partitions.partitions import Group, UserPartition
|
||||
from user_api.tests.factories import UserCourseTagFactory
|
||||
from openedx.core.djangoapps.user_api.tests.factories import UserCourseTagFactory
|
||||
|
||||
|
||||
@override_settings(MODULESTORE=TEST_DATA_MOCK_MODULESTORE)
|
||||
|
||||
@@ -6,11 +6,7 @@ from django.http import Http404
|
||||
from django.test.client import Client, RequestFactory
|
||||
from django.test.utils import override_settings
|
||||
from edxmako.tests import mako_middleware_process_request
|
||||
from mock import patch, Mock, ANY, call
|
||||
from nose.tools import assert_true # pylint: disable=no-name-in-module
|
||||
|
||||
from course_groups.models import CourseUserGroup
|
||||
from courseware.courses import UserNotEnrolled
|
||||
from django_comment_client.forum import views
|
||||
from django_comment_client.tests.group_id import (
|
||||
CohortedTopicGroupIdTestMixin,
|
||||
@@ -21,10 +17,15 @@ from django_comment_client.tests.utils import CohortedContentTestCase
|
||||
from django_comment_client.utils import strip_none
|
||||
from student.tests.factories import UserFactory, CourseEnrollmentFactory
|
||||
from util.testing import UrlResetMixin
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_MOCK_MODULESTORE
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
|
||||
from courseware.courses import UserNotEnrolled
|
||||
from nose.tools import assert_true # pylint: disable=E0611
|
||||
from mock import patch, Mock, ANY, call
|
||||
|
||||
from openedx.core.djangoapps.course_groups.models import CourseUserGroup
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
# pylint: disable=missing-docstring
|
||||
|
||||
@@ -11,7 +11,12 @@ import newrelic.agent
|
||||
|
||||
from edxmako.shortcuts import render_to_response
|
||||
from courseware.courses import get_course_with_access
|
||||
from course_groups.cohorts import is_course_cohorted, get_cohort_id, get_course_cohorts, is_commentable_cohorted
|
||||
from openedx.core.djangoapps.course_groups.cohorts import (
|
||||
is_course_cohorted,
|
||||
get_cohort_id,
|
||||
get_course_cohorts,
|
||||
is_commentable_cohorted
|
||||
)
|
||||
from courseware.access import has_access
|
||||
|
||||
from django_comment_client.permissions import cached_has_permission
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import json
|
||||
import re
|
||||
|
||||
from course_groups.models import CourseUserGroup
|
||||
|
||||
|
||||
class GroupIdAssertionMixin(object):
|
||||
def _data_or_params_cs_request(self, mock_request):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from django.test.utils import override_settings
|
||||
from mock import patch
|
||||
|
||||
from course_groups.models import CourseUserGroup
|
||||
from openedx.core.djangoapps.course_groups.models import CourseUserGroup
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
|
||||
from django_comment_common.models import Role
|
||||
from django_comment_common.utils import seed_permissions_roles
|
||||
|
||||
@@ -17,8 +17,8 @@ from django_comment_client.permissions import check_permissions_by_view, cached_
|
||||
from edxmako import lookup_template
|
||||
import pystache_custom as pystache
|
||||
|
||||
from course_groups.cohorts import get_cohort_by_id, get_cohort_id, is_commentable_cohorted, is_course_cohorted
|
||||
from course_groups.models import CourseUserGroup
|
||||
from openedx.core.djangoapps.course_groups.cohorts import get_cohort_by_id, get_cohort_id, is_commentable_cohorted, is_course_cohorted
|
||||
from openedx.core.djangoapps.course_groups.models import CourseUserGroup
|
||||
from opaque_keys.edx.locations import i4xEncoder
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
@@ -62,7 +62,7 @@ import instructor_analytics.basic
|
||||
import instructor_analytics.distributions
|
||||
import instructor_analytics.csvs
|
||||
import csv
|
||||
from user_api.models import UserPreference
|
||||
from openedx.core.djangoapps.user_api.models import UserPreference
|
||||
from instructor.views import INVOICE_KEY
|
||||
|
||||
from submissions import api as sub_api # installed from the edx-submissions repository
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
Tests for instructor.basic
|
||||
"""
|
||||
|
||||
from django.test import TestCase
|
||||
from student.models import CourseEnrollment
|
||||
from django.core.urlresolvers import reverse
|
||||
from mock import patch
|
||||
@@ -17,12 +16,10 @@ from instructor_analytics.basic import (
|
||||
sale_record_features, sale_order_record_features, enrolled_students_features, course_registration_features,
|
||||
coupon_codes_features, AVAILABLE_FEATURES, STUDENT_FEATURES, PROFILE_FEATURES
|
||||
)
|
||||
from course_groups.tests.helpers import CohortFactory
|
||||
from course_groups.models import CourseUserGroup
|
||||
from openedx.core.djangoapps.course_groups.tests.helpers import CohortFactory
|
||||
from courseware.tests.factories import InstructorFactory
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
|
||||
|
||||
class TestAnalyticsBasic(ModuleStoreTestCase):
|
||||
|
||||
@@ -17,7 +17,7 @@ from django.core.urlresolvers import reverse
|
||||
|
||||
from capa.tests.response_xml_factory import (CodeResponseXMLFactory,
|
||||
CustomResponseXMLFactory)
|
||||
from user_api.tests.factories import UserCourseTagFactory
|
||||
from openedx.core.djangoapps.user_api.tests.factories import UserCourseTagFactory
|
||||
from xmodule.modulestore.tests.factories import ItemFactory
|
||||
from xmodule.modulestore import ModuleStoreEnum
|
||||
from xmodule.partitions.partitions import Group, UserPartition
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from django.contrib.auth.models import User
|
||||
from lettuce import step, world
|
||||
from notification_prefs import NOTIFICATION_PREF_KEY
|
||||
from user_api.models import UserPreference
|
||||
from openedx.core.djangoapps.user_api.models import UserPreference
|
||||
|
||||
|
||||
USERNAME = "robot"
|
||||
|
||||
@@ -12,7 +12,7 @@ from notification_prefs import NOTIFICATION_PREF_KEY
|
||||
from notification_prefs.views import ajax_enable, ajax_disable, ajax_status, set_subscription, UsernameCipher
|
||||
from student.tests.factories import UserFactory
|
||||
from edxmako.tests import mako_middleware_process_request
|
||||
from user_api.models import UserPreference
|
||||
from openedx.core.djangoapps.user_api.models import UserPreference
|
||||
from util.testing import UrlResetMixin
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ from django.views.decorators.http import require_GET, require_POST
|
||||
|
||||
from edxmako.shortcuts import render_to_response
|
||||
from notification_prefs import NOTIFICATION_PREF_KEY
|
||||
from user_api.models import UserPreference
|
||||
from openedx.core.djangoapps.user_api.models import UserPreference
|
||||
|
||||
|
||||
class UsernameDecryptionException(Exception):
|
||||
|
||||
@@ -2,7 +2,7 @@ from django.contrib.auth.models import User
|
||||
from django.http import Http404
|
||||
from rest_framework import serializers
|
||||
|
||||
from course_groups.cohorts import is_course_cohorted
|
||||
from openedx.core.djangoapps.course_groups.cohorts import is_course_cohorted
|
||||
from notification_prefs import NOTIFICATION_PREF_KEY
|
||||
from lang_pref import LANGUAGE_KEY
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ from django.conf import settings
|
||||
from django.test.client import RequestFactory
|
||||
from django.test.utils import override_settings
|
||||
|
||||
from course_groups.models import CourseUserGroup
|
||||
from openedx.core.djangoapps.course_groups.models import CourseUserGroup
|
||||
from django_comment_common.models import Role, Permission
|
||||
from lang_pref import LANGUAGE_KEY
|
||||
from notification_prefs import NOTIFICATION_PREF_KEY
|
||||
@@ -13,8 +13,8 @@ from notifier_api.views import NotifierUsersViewSet
|
||||
from opaque_keys.edx.locator import CourseLocator
|
||||
from student.models import CourseEnrollment
|
||||
from student.tests.factories import UserFactory, CourseEnrollmentFactory
|
||||
from user_api.models import UserPreference
|
||||
from user_api.tests.factories import UserPreferenceFactory
|
||||
from openedx.core.djangoapps.user_api.models import UserPreference
|
||||
from openedx.core.djangoapps.user_api.tests.factories import UserPreferenceFactory
|
||||
from util.testing import UrlResetMixin
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
|
||||
@@ -3,7 +3,7 @@ from rest_framework.viewsets import ReadOnlyModelViewSet
|
||||
|
||||
from notification_prefs import NOTIFICATION_PREF_KEY
|
||||
from notifier_api.serializers import NotifierUserSerializer
|
||||
from user_api.views import ApiKeyHeaderPermission
|
||||
from openedx.core.djangoapps.user_api.views import ApiKeyHeaderPermission
|
||||
|
||||
|
||||
class NotifierUsersViewSet(ReadOnlyModelViewSet):
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.core.cache import cache
|
||||
from courseware.access import has_access
|
||||
from student.models import anonymous_id_for_user
|
||||
from student.models import UserProfile
|
||||
from user_api.models import UserPreference
|
||||
from openedx.core.djangoapps.user_api.models import UserPreference
|
||||
from lang_pref import LANGUAGE_KEY
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.course_module import CourseDescriptor
|
||||
|
||||
@@ -9,7 +9,7 @@ from student.models import anonymous_id_for_user
|
||||
from student.models import UserProfile
|
||||
from student.roles import CourseStaffRole, CourseInstructorRole
|
||||
from student.tests.factories import UserFactory, UserProfileFactory
|
||||
from user_api.models import UserPreference
|
||||
from openedx.core.djangoapps.user_api.models import UserPreference
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
|
||||
# Will also run default tests for IDTokens and UserInfo
|
||||
|
||||
@@ -16,9 +16,8 @@ from django.test.utils import override_settings
|
||||
|
||||
from util.testing import UrlResetMixin
|
||||
from third_party_auth.tests.testutil import simulate_running_pipeline
|
||||
from user_api.api import account as account_api
|
||||
from user_api.api import profile as profile_api
|
||||
from util.bad_request_rate_limiter import BadRequestRateLimiter
|
||||
from openedx.core.djangoapps.user_api.api import account as account_api
|
||||
from openedx.core.djangoapps.user_api.api import profile as profile_api
|
||||
from xmodule.modulestore.tests.django_utils import (
|
||||
ModuleStoreTestCase, mixed_store_config
|
||||
)
|
||||
|
||||
@@ -16,8 +16,8 @@ from edxmako.shortcuts import render_to_response, render_to_string
|
||||
from microsite_configuration import microsite
|
||||
import third_party_auth
|
||||
|
||||
from user_api.api import account as account_api
|
||||
from user_api.api import profile as profile_api
|
||||
from openedx.core.djangoapps.user_api.api import account as account_api
|
||||
from openedx.core.djangoapps.user_api.api import profile as profile_api
|
||||
from util.bad_request_rate_limiter import BadRequestRateLimiter
|
||||
|
||||
from student_account.helpers import auth_pipeline_urls
|
||||
|
||||
@@ -11,8 +11,8 @@ from django.conf import settings
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from util.testing import UrlResetMixin
|
||||
from user_api.api import account as account_api
|
||||
from user_api.api import profile as profile_api
|
||||
from openedx.core.djangoapps.user_api.api import account as account_api
|
||||
from openedx.core.djangoapps.user_api.api import profile as profile_api
|
||||
from lang_pref import LANGUAGE_KEY, api as language_api
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ from django.views.decorators.http import require_http_methods
|
||||
from django_future.csrf import ensure_csrf_cookie
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from edxmako.shortcuts import render_to_response
|
||||
from user_api.api import profile as profile_api
|
||||
from openedx.core.djangoapps.user_api.api import profile as profile_api
|
||||
from lang_pref import LANGUAGE_KEY, api as language_api
|
||||
import third_party_auth
|
||||
|
||||
|
||||
Reference in New Issue
Block a user