Merge pull request #19793 from edx/youngstrom/remove-commonlib-shards
Remove shards from commonlib-unit tests
This commit is contained in:
@@ -41,7 +41,6 @@ class BookmarksAPITests(BookmarkApiEventTestMixin, BookmarksTestsBase):
|
||||
"""
|
||||
These tests cover the parts of the API methods.
|
||||
"""
|
||||
shard = 9
|
||||
|
||||
def test_get_bookmark(self):
|
||||
"""
|
||||
|
||||
@@ -229,7 +229,6 @@ class BookmarkModelTests(BookmarksTestsBase):
|
||||
"""
|
||||
Test the Bookmark model.
|
||||
"""
|
||||
shard = 9
|
||||
|
||||
def setUp(self):
|
||||
super(BookmarkModelTests, self).setUp()
|
||||
@@ -415,7 +414,6 @@ class XBlockCacheModelTest(ModuleStoreTestCase):
|
||||
"""
|
||||
Test the XBlockCache model.
|
||||
"""
|
||||
shard = 9
|
||||
COURSE_KEY = CourseLocator(org='test', course='test', run='test')
|
||||
CHAPTER1_USAGE_KEY = BlockUsageLocator(COURSE_KEY, block_type='chapter', block_id='chapter1')
|
||||
SECTION1_USAGE_KEY = BlockUsageLocator(COURSE_KEY, block_type='section', block_id='section1')
|
||||
|
||||
@@ -14,7 +14,6 @@ class BookmarksServiceTests(BookmarksTestsBase):
|
||||
"""
|
||||
Tests the Bookmarks service.
|
||||
"""
|
||||
shard = 9
|
||||
|
||||
def setUp(self):
|
||||
super(BookmarksServiceTests, self).setUp()
|
||||
|
||||
@@ -15,7 +15,6 @@ class XBlockCacheTaskTests(BookmarksTestsBase):
|
||||
"""
|
||||
Test the XBlockCache model.
|
||||
"""
|
||||
shard = 9
|
||||
|
||||
def setUp(self):
|
||||
super(XBlockCacheTaskTests, self).setUp()
|
||||
|
||||
@@ -68,7 +68,6 @@ class BookmarksListViewTests(BookmarksViewsTestsBase):
|
||||
GET /api/bookmarks/v1/bookmarks/?course_id={course_id1}
|
||||
POST /api/bookmarks/v1/bookmarks
|
||||
"""
|
||||
shard = 9
|
||||
|
||||
@ddt.data(
|
||||
(1, False),
|
||||
@@ -372,7 +371,6 @@ class BookmarksDetailViewTests(BookmarksViewsTestsBase):
|
||||
"""
|
||||
This contains the tests for GET & DELETE methods of bookmark.views.BookmarksDetailView class
|
||||
"""
|
||||
shard = 9
|
||||
|
||||
@ddt.data(
|
||||
('', False),
|
||||
|
||||
@@ -42,7 +42,6 @@ class APIsTestCase(SharedModuleStoreTestCase):
|
||||
Unit tests for the API module functions
|
||||
"""
|
||||
MODULESTORE = TEST_DATA_SPLIT_MODULESTORE
|
||||
shard = 1
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
||||
@@ -15,7 +15,6 @@ class CCXConSignalTestCase(TestCase):
|
||||
the call for the ccxcon update are performed correctly by the
|
||||
course_published signal handler
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
@mock.patch('openedx.core.djangoapps.ccxcon.tasks.update_ccxcon.delay')
|
||||
def test_course_published_ccxcon_call(self, mock_upc):
|
||||
|
||||
@@ -14,7 +14,6 @@ class CCXConTaskTestCase(TestCase):
|
||||
"""
|
||||
Tests for CCXCon tasks.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
@mock.patch('openedx.core.djangoapps.ccxcon.api.course_info_to_ccxcon')
|
||||
def test_update_ccxcon_task_ok(self, mock_citc):
|
||||
|
||||
@@ -22,7 +22,6 @@ class TestBlockStructure(TestCase, ChildrenMapTestMixin):
|
||||
"""
|
||||
Tests for BlockStructure
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
@ddt.data(
|
||||
[],
|
||||
@@ -52,7 +51,6 @@ class TestBlockStructureData(TestCase, ChildrenMapTestMixin):
|
||||
"""
|
||||
Tests for BlockStructureBlockData and BlockStructureModulestoreData
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def test_non_versioned_transformer(self):
|
||||
class TestNonVersionedTransformer(MockTransformer):
|
||||
|
||||
@@ -16,7 +16,6 @@ class TestBlockStructureFactory(TestCase, ChildrenMapTestMixin):
|
||||
"""
|
||||
Tests for BlockStructureFactory
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(TestBlockStructureFactory, self).setUp()
|
||||
|
||||
@@ -93,7 +93,6 @@ class TestBlockStructureManager(UsageKeyFactoryMixin, ChildrenMapTestMixin, Test
|
||||
"""
|
||||
Test class for BlockStructureManager.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(TestBlockStructureManager, self).setUp()
|
||||
|
||||
@@ -18,7 +18,6 @@ class TestBlockStructureStore(UsageKeyFactoryMixin, ChildrenMapTestMixin, CacheI
|
||||
Tests for BlockStructureStore
|
||||
"""
|
||||
ENABLED_CACHES = ['default']
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(TestBlockStructureStore, self).setUp()
|
||||
|
||||
@@ -35,7 +35,6 @@ class TransformerRegistryTestCase(TestCase):
|
||||
"""
|
||||
Test cases for TransformerRegistry.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def tearDown(self):
|
||||
super(TransformerRegistryTestCase, self).tearDown()
|
||||
|
||||
@@ -16,7 +16,6 @@ class TestBlockStructureTransformers(ChildrenMapTestMixin, TestCase):
|
||||
"""
|
||||
Test class for testing BlockStructureTransformers
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
class UnregisteredTransformer(MockTransformer):
|
||||
"""
|
||||
|
||||
@@ -15,7 +15,6 @@ class TestGenerateCourseOverview(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests course overview management command.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
|
||||
@@ -46,7 +46,6 @@ class CourseOverviewTestCase(CatalogIntegrationMixin, ModuleStoreTestCase, Cache
|
||||
"""
|
||||
Tests for CourseOverview model.
|
||||
"""
|
||||
shard = 3
|
||||
TODAY = timezone.now()
|
||||
LAST_MONTH = 'last_month'
|
||||
LAST_WEEK = 'last_week'
|
||||
@@ -564,7 +563,6 @@ class CourseOverviewImageSetTestCase(ModuleStoreTestCase):
|
||||
Course thumbnail generation tests.
|
||||
"""
|
||||
ENABLED_SIGNALS = ['course_published']
|
||||
shard = 3
|
||||
|
||||
def setUp(self):
|
||||
"""Create an active CourseOverviewImageConfig with non-default values."""
|
||||
@@ -1042,7 +1040,6 @@ class CourseOverviewTabTestCase(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests for CourseOverviewTab model.
|
||||
"""
|
||||
shard = 3
|
||||
|
||||
ENABLED_SIGNALS = ['course_published']
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ class CourseOverviewSignalsTestCase(ModuleStoreTestCase):
|
||||
ENABLED_SIGNALS = ['course_deleted', 'course_published']
|
||||
TODAY = datetime.datetime.utcnow()
|
||||
NEXT_WEEK = TODAY + datetime.timedelta(days=7)
|
||||
shard = 3
|
||||
|
||||
@ddt.data(ModuleStoreEnum.Type.mongo, ModuleStoreEnum.Type.split)
|
||||
def test_caching(self, modulestore_type):
|
||||
|
||||
@@ -33,7 +33,6 @@ class TestCohortSignals(TestCase):
|
||||
"""
|
||||
Test cases to validate event emissions for various cohort-related workflows
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(TestCohortSignals, self).setUp()
|
||||
@@ -140,7 +139,6 @@ class TestCohorts(ModuleStoreTestCase):
|
||||
Test the cohorts feature
|
||||
"""
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
@@ -750,7 +748,6 @@ class TestCohortsAndPartitionGroups(ModuleStoreTestCase):
|
||||
Test Cohorts and Partitions Groups.
|
||||
"""
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
|
||||
@@ -14,7 +14,6 @@ from xmodule.modulestore.tests.factories import ToyCourseFactory
|
||||
|
||||
from openedx.core.djangoapps.user_api.partition_schemes import RandomUserPartitionScheme
|
||||
from openedx.core.djangolib.testing.utils import skip_unless_lms
|
||||
from openedx.core.lib.tests import attr
|
||||
from ..partition_scheme import CohortPartitionScheme, get_cohorted_user_partition
|
||||
from ..models import CourseUserGroupPartitionGroup
|
||||
from ..views import link_cohort_to_partition_group, unlink_cohort_partition_group
|
||||
@@ -22,7 +21,6 @@ from ..cohorts import add_user_to_cohort, remove_user_from_cohort, get_course_co
|
||||
from .helpers import CohortFactory, config_course_cohorts
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
class TestCohortPartitionScheme(ModuleStoreTestCase):
|
||||
"""
|
||||
Test the logic for linking a user to a partition group based on their cohort.
|
||||
@@ -256,7 +254,6 @@ class TestCohortPartitionScheme(ModuleStoreTestCase):
|
||||
self.assertRegexpMatches(mock_log.warn.call_args[0][0], 'partition mismatch')
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
class TestExtension(django.test.TestCase):
|
||||
"""
|
||||
Ensure that the scheme extension is correctly plugged in (via entry point
|
||||
@@ -269,7 +266,6 @@ class TestExtension(django.test.TestCase):
|
||||
UserPartition.get_scheme('other')
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
class TestGetCohortedUserPartition(ModuleStoreTestCase):
|
||||
"""
|
||||
Test that `get_cohorted_user_partition` returns the first user_partition with scheme `CohortPartitionScheme`.
|
||||
@@ -327,7 +323,6 @@ class TestGetCohortedUserPartition(ModuleStoreTestCase):
|
||||
self.assertIsNone(get_cohorted_user_partition(self.course))
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
class TestMasqueradedGroup(StaffMasqueradeTestCase):
|
||||
"""
|
||||
Check for staff being able to masquerade as belonging to a group.
|
||||
|
||||
@@ -13,7 +13,6 @@ from django_comment_common.models import CourseDiscussionSettings
|
||||
from django_comment_common.utils import get_course_discussion_settings
|
||||
from lms.djangoapps.courseware.tests.factories import StaffFactory, InstructorFactory
|
||||
from opaque_keys.edx.locator import CourseLocator
|
||||
from openedx.core.lib.tests import attr
|
||||
from student.models import CourseEnrollment
|
||||
from student.tests.factories import UserFactory
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
@@ -32,7 +31,6 @@ from ..views import (
|
||||
from .helpers import CohortFactory, CourseCohortFactory, config_course_cohorts, config_course_cohorts_legacy
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
class CohortViewsTestCase(ModuleStoreTestCase):
|
||||
"""
|
||||
Base class which sets up a course and staff/non-staff users.
|
||||
@@ -144,7 +142,6 @@ class CohortViewsTestCase(ModuleStoreTestCase):
|
||||
return json.loads(response.content)
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
class CourseCohortSettingsHandlerTestCase(CohortViewsTestCase):
|
||||
"""
|
||||
Tests the `course_cohort_settings_handler` view.
|
||||
@@ -234,7 +231,6 @@ class CourseCohortSettingsHandlerTestCase(CohortViewsTestCase):
|
||||
)
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
class CohortHandlerTestCase(CohortViewsTestCase):
|
||||
"""
|
||||
Tests the `cohort_handler` view.
|
||||
@@ -604,7 +600,6 @@ class CohortHandlerTestCase(CohortViewsTestCase):
|
||||
)
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
class UsersInCohortTestCase(CohortViewsTestCase):
|
||||
"""
|
||||
Tests the `users_in_cohort` view.
|
||||
@@ -737,7 +732,6 @@ class UsersInCohortTestCase(CohortViewsTestCase):
|
||||
self.request_users_in_cohort(cohort, self.course, -1, should_return_bad_request=True)
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
class AddUsersToCohortTestCase(CohortViewsTestCase):
|
||||
"""
|
||||
Tests the `add_users_to_cohort` view.
|
||||
@@ -1130,7 +1124,6 @@ class AddUsersToCohortTestCase(CohortViewsTestCase):
|
||||
)
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
class RemoveUserFromCohortTestCase(CohortViewsTestCase):
|
||||
"""
|
||||
Tests the `remove_user_from_cohort` view.
|
||||
|
||||
@@ -13,7 +13,6 @@ CREDENTIALS_PUBLIC_SERVICE_URL = 'https://credentials.example.com'
|
||||
@skip_unless_lms
|
||||
class TestCredentialsApiConfig(CredentialsApiConfigMixin, TestCase):
|
||||
"""Tests covering the CredentialsApiConfig model."""
|
||||
shard = 2
|
||||
|
||||
@override_settings(
|
||||
CREDENTIALS_INTERNAL_SERVICE_URL=CREDENTIALS_INTERNAL_SERVICE_URL,
|
||||
|
||||
@@ -20,7 +20,6 @@ UTILS_MODULE = 'openedx.core.djangoapps.credentials.utils'
|
||||
@mock.patch(UTILS_MODULE + '.get_edx_api_data')
|
||||
class TestGetCredentials(CredentialsApiConfigMixin, CacheIsolationTestCase):
|
||||
""" Tests for credentials utility functions. """
|
||||
shard = 2
|
||||
|
||||
ENABLED_CACHES = ['default']
|
||||
|
||||
|
||||
@@ -207,7 +207,6 @@ class CreditRequirementApiTests(CreditApiTestBase):
|
||||
"""
|
||||
Test Python API for credit requirements and eligibility.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
@ddt.data(
|
||||
[
|
||||
@@ -878,7 +877,6 @@ class CreditProviderIntegrationApiTests(CreditApiTestBase):
|
||||
"""
|
||||
Test Python API for credit provider integration.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
USER_INFO = {
|
||||
"username": "bob",
|
||||
@@ -1208,7 +1206,6 @@ class CreditProviderIntegrationApiTests(CreditApiTestBase):
|
||||
@ddt.ddt
|
||||
class CourseApiTests(CreditApiTestBase):
|
||||
"""Test Python API for course product information."""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(CourseApiTests, self).setUp()
|
||||
|
||||
@@ -38,7 +38,6 @@ class CreditEligibilityModelTests(TestCase):
|
||||
"""
|
||||
Tests for credit models used to track credit eligibility.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(CreditEligibilityModelTests, self).setUp()
|
||||
|
||||
@@ -11,7 +11,6 @@ from student.tests.factories import UserFactory
|
||||
|
||||
class CreditProviderSerializerTests(TestCase):
|
||||
""" CreditProviderSerializer tests. """
|
||||
shard = 2
|
||||
|
||||
def test_data(self):
|
||||
""" Verify the correct fields are serialized. """
|
||||
@@ -32,7 +31,6 @@ class CreditProviderSerializerTests(TestCase):
|
||||
|
||||
class CreditEligibilitySerializerTests(TestCase):
|
||||
""" CreditEligibilitySerializer tests. """
|
||||
shard = 2
|
||||
|
||||
def test_data(self):
|
||||
""" Verify the correct fields are serialized. """
|
||||
|
||||
@@ -20,7 +20,6 @@ class CreditServiceTests(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests for the Credit xBlock service
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(CreditServiceTests, self).setUp()
|
||||
|
||||
@@ -32,7 +32,6 @@ class TestMinGradedRequirementStatus(ModuleStoreTestCase):
|
||||
"""
|
||||
VALID_DUE_DATE = datetime.now(pytz.UTC) + timedelta(days=20)
|
||||
EXPIRED_DUE_DATE = datetime.now(pytz.UTC) - timedelta(days=20)
|
||||
shard = 2
|
||||
|
||||
DATES = {
|
||||
'valid': VALID_DUE_DATE,
|
||||
|
||||
@@ -16,7 +16,6 @@ class SignatureTest(TestCase):
|
||||
"""
|
||||
Tests for digital signatures.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def test_unicode_secret_key(self):
|
||||
# Test a key that has type `unicode` but consists of ASCII characters
|
||||
|
||||
@@ -23,7 +23,6 @@ class TestTaskExecution(ModuleStoreTestCase):
|
||||
allows us to ensure that when the listener is executed, it is done as
|
||||
expected.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def mocked_set_credit_requirements(course_key, requirements): # pylint: disable=no-self-argument, unused-argument
|
||||
"""Used as a side effect when mocking method credit api method
|
||||
|
||||
@@ -26,7 +26,6 @@ from openedx.core.djangoapps.credit.tests.factories import (
|
||||
)
|
||||
from openedx.core.djangoapps.oauth_dispatch.jwt import create_jwt_for_user
|
||||
from openedx.core.djangolib.testing.utils import skip_unless_lms
|
||||
from openedx.core.lib.tests import attr
|
||||
from student.tests.factories import UserFactory, AdminFactory
|
||||
from util.date_utils import to_timestamp
|
||||
|
||||
@@ -108,7 +107,6 @@ class ReadOnlyMixin(object):
|
||||
self.assertEqual(response.status_code, 405)
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
@skip_unless_lms
|
||||
class CreditCourseViewSetTests(AuthMixin, UserMixin, TestCase):
|
||||
""" Tests for the CreditCourse endpoints.
|
||||
@@ -270,7 +268,6 @@ class CreditCourseViewSetTests(AuthMixin, UserMixin, TestCase):
|
||||
self.assertTrue(credit_course.enabled)
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
@ddt.ddt
|
||||
@skip_unless_lms
|
||||
class CreditProviderViewSetTests(ApiTestCaseMixin, ReadOnlyMixin, AuthMixin, UserMixin, TestCase):
|
||||
@@ -315,7 +312,6 @@ class CreditProviderViewSetTests(ApiTestCaseMixin, ReadOnlyMixin, AuthMixin, Use
|
||||
self.assertEqual(response.data, CreditProviderSerializer(self.bayside).data)
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
@skip_unless_lms
|
||||
class CreditProviderRequestCreateViewTests(ApiTestCaseMixin, UserMixin, TestCase):
|
||||
""" Tests for CreditProviderRequestCreateView. """
|
||||
@@ -464,7 +460,6 @@ class CreditProviderRequestCreateViewTests(ApiTestCaseMixin, UserMixin, TestCase
|
||||
self.assertEqual(response.status_code, 400)
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
@ddt.ddt
|
||||
@skip_unless_lms
|
||||
class CreditProviderCallbackViewTests(UserMixin, TestCase):
|
||||
@@ -622,7 +617,6 @@ class CreditProviderCallbackViewTests(UserMixin, TestCase):
|
||||
self.assertEqual(response.status_code, 403)
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
@ddt.ddt
|
||||
@skip_unless_lms
|
||||
class CreditEligibilityViewTests(AuthMixin, UserMixin, ReadOnlyMixin, TestCase):
|
||||
|
||||
@@ -43,7 +43,6 @@ MODULESTORE_CONFIG = mixed_store_config(settings.COMMON_TEST_DATA_ROOT, {})
|
||||
@mock.patch.dict(settings.FEATURES, {'EMBARGO': True})
|
||||
class EmbargoCheckAccessApiTests(ModuleStoreTestCase):
|
||||
"""Test the embargo API calls to determine whether a user has access. """
|
||||
shard = 3
|
||||
ENABLED_CACHES = ['default', 'mongo_metadata_inheritance', 'loc_cache']
|
||||
|
||||
def setUp(self):
|
||||
|
||||
@@ -34,7 +34,6 @@ class EmbargoMiddlewareAccessTests(UrlResetMixin, ModuleStoreTestCase):
|
||||
PASSWORD = 'secret'
|
||||
|
||||
URLCONF_MODULES = ['openedx.core.djangoapps.embargo']
|
||||
shard = 3
|
||||
|
||||
@patch.dict(settings.FEATURES, {'EMBARGO': True})
|
||||
def setUp(self):
|
||||
|
||||
@@ -81,7 +81,6 @@ class ShibSPTest(CacheIsolationTestCase):
|
||||
Tests for the Shibboleth SP, which communicates via request.META
|
||||
(Apache environment variables set by mod_shib)
|
||||
"""
|
||||
shard = 3
|
||||
|
||||
ENABLED_CACHES = ['default']
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ class CourseDetailsTestCase(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests the first course settings page (course dates, overview, etc.).
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(CourseDetailsTestCase, self).setUp()
|
||||
|
||||
@@ -39,7 +39,6 @@ class TestValidateUploadedImage(TestCase):
|
||||
valid_file_types=_get_valid_file_types()
|
||||
)
|
||||
)
|
||||
shard = 2
|
||||
|
||||
def check_validation_result(self, uploaded_file, expected_failure_message):
|
||||
"""
|
||||
@@ -130,7 +129,6 @@ class TestGenerateProfileImages(TestCase):
|
||||
"""
|
||||
Test create_profile_images
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def check_exif_orientation(self, image, expected_orientation):
|
||||
"""
|
||||
@@ -227,7 +225,6 @@ class TestRemoveProfileImages(TestCase):
|
||||
"""
|
||||
Test remove_profile_images
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def test_remove(self):
|
||||
"""
|
||||
|
||||
@@ -22,7 +22,6 @@ from openedx.core.djangoapps.user_api.accounts.image_helpers import (
|
||||
get_profile_image_storage,
|
||||
)
|
||||
from openedx.core.djangolib.testing.utils import skip_unless_lms
|
||||
from openedx.core.lib.tests import attr
|
||||
|
||||
from ..images import create_profile_images, ImageValidationError
|
||||
from ..views import LOG_MESSAGE_CREATE, LOG_MESSAGE_DELETE
|
||||
@@ -116,7 +115,6 @@ class ProfileImageEndpointMixin(UserSettingsEventTestMixin):
|
||||
self.assert_no_events_were_emitted()
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
@skip_unless_lms
|
||||
@mock.patch('openedx.core.djangoapps.profile_images.views.log')
|
||||
class ProfileImageViewGeneralTestCase(ProfileImageEndpointMixin, APITestCase):
|
||||
@@ -136,7 +134,6 @@ class ProfileImageViewGeneralTestCase(ProfileImageEndpointMixin, APITestCase):
|
||||
self.assert_no_events_were_emitted()
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
@ddt.ddt
|
||||
@skip_unless_lms
|
||||
@mock.patch('openedx.core.djangoapps.profile_images.views.log')
|
||||
@@ -359,7 +356,6 @@ class ProfileImageViewPostTestCase(ProfileImageEndpointMixin, APITestCase):
|
||||
self.assert_no_events_were_emitted()
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
@skip_unless_lms
|
||||
@mock.patch('openedx.core.djangoapps.profile_images.views.log')
|
||||
class ProfileImageViewDeleteTestCase(ProfileImageEndpointMixin, APITestCase):
|
||||
@@ -490,7 +486,6 @@ class DeprecatedProfileImageTestMixin(ProfileImageEndpointMixin):
|
||||
self.assert_no_events_were_emitted()
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
@skip_unless_lms
|
||||
@mock.patch('openedx.core.djangoapps.profile_images.views.log')
|
||||
class DeprecatedProfileImageUploadTestCase(DeprecatedProfileImageTestMixin, APITestCase):
|
||||
@@ -503,7 +498,6 @@ class DeprecatedProfileImageUploadTestCase(DeprecatedProfileImageTestMixin, APIT
|
||||
_replacement_method = 'openedx.core.djangoapps.profile_images.views.ProfileImageView.post'
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
@skip_unless_lms
|
||||
@mock.patch('openedx.core.djangoapps.profile_images.views.log')
|
||||
class DeprecatedProfileImageRemoveTestCase(DeprecatedProfileImageTestMixin, APITestCase):
|
||||
|
||||
@@ -29,7 +29,6 @@ class CertAwardedReceiverTest(TestCase):
|
||||
"""
|
||||
Tests for the `handle_course_cert_awarded` signal handler function.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
@property
|
||||
def signal_kwargs(self):
|
||||
@@ -91,7 +90,6 @@ class CertChangedReceiverTest(TestCase):
|
||||
"""
|
||||
Tests for the `handle_course_cert_changed` signal handler function.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(CertChangedReceiverTest, self).setUp()
|
||||
|
||||
@@ -57,7 +57,6 @@ UTILS_MODULE = 'openedx.core.djangoapps.programs.utils'
|
||||
@mock.patch(UTILS_MODULE + '.get_programs')
|
||||
class TestProgramProgressMeter(TestCase):
|
||||
"""Tests of the program progress utility class."""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(TestProgramProgressMeter, self).setUp()
|
||||
|
||||
@@ -23,7 +23,6 @@ class TestSafeSessionProcessRequest(TestSafeSessionsLogMixin, TestCase):
|
||||
"""
|
||||
Test class for SafeSessionMiddleware.process_request
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(TestSafeSessionProcessRequest, self).setUp()
|
||||
@@ -127,7 +126,6 @@ class TestSafeSessionProcessResponse(TestSafeSessionsLogMixin, TestCase):
|
||||
"""
|
||||
Test class for SafeSessionMiddleware.process_response
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(TestSafeSessionProcessResponse, self).setUp()
|
||||
@@ -233,7 +231,6 @@ class TestSafeSessionMiddleware(TestSafeSessionsLogMixin, TestCase):
|
||||
Test class for SafeSessionMiddleware, testing both
|
||||
process_request and process_response.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(TestSafeSessionMiddleware, self).setUp()
|
||||
|
||||
@@ -18,7 +18,6 @@ class TestSafeCookieData(TestSafeSessionsLogMixin, TestCase):
|
||||
"""
|
||||
Test class for SafeCookieData
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(TestSafeCookieData, self).setUp()
|
||||
|
||||
@@ -31,7 +31,6 @@ from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
"Can't test schedules if the app isn't installed",
|
||||
)
|
||||
class TestSendCourseUpdate(ScheduleUpsellTestMixin, ScheduleSendEmailTestMixin, ModuleStoreTestCase):
|
||||
shard = 6
|
||||
__test__ = True
|
||||
|
||||
# pylint: disable=protected-access
|
||||
|
||||
@@ -16,7 +16,6 @@ from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, skip_un
|
||||
@skipUnless('openedx.core.djangoapps.schedules.apps.SchedulesConfig' in settings.INSTALLED_APPS,
|
||||
"Can't test schedules if the app isn't installed")
|
||||
class TestSendEmailBaseCommand(CacheIsolationTestCase):
|
||||
shard = 6
|
||||
|
||||
def setUp(self):
|
||||
self.command = SendEmailBaseCommand()
|
||||
|
||||
@@ -24,7 +24,6 @@ from openedx.core.djangolib.testing.utils import skip_unless_lms, CacheIsolation
|
||||
"Can't test schedules if the app isn't installed",
|
||||
)
|
||||
class TestSendRecurringNudge(ScheduleUpsellTestMixin, ScheduleSendEmailTestMixin, CacheIsolationTestCase):
|
||||
shard = 6
|
||||
__test__ = True
|
||||
|
||||
# pylint: disable=protected-access
|
||||
|
||||
@@ -31,7 +31,6 @@ LOG = logging.getLogger(__name__)
|
||||
@skipUnless('openedx.core.djangoapps.schedules.apps.SchedulesConfig' in settings.INSTALLED_APPS,
|
||||
"Can't test schedules if the app isn't installed")
|
||||
class TestUpgradeReminder(ScheduleSendEmailTestMixin, CacheIsolationTestCase):
|
||||
shard = 6
|
||||
__test__ = True
|
||||
|
||||
resolver = resolvers.UpgradeReminderResolver
|
||||
|
||||
@@ -58,7 +58,6 @@ from openedx.core.djangoapps.user_api.errors import (
|
||||
UserNotFound
|
||||
)
|
||||
from openedx.core.djangolib.testing.utils import skip_unless_lms
|
||||
from openedx.core.lib.tests import attr
|
||||
from student.models import PendingEmailChange
|
||||
from student.tests.factories import UserFactory
|
||||
from student.tests.tests import UserSettingsEventTestMixin
|
||||
@@ -69,7 +68,6 @@ def mock_render_to_string(template_name, context):
|
||||
return str((template_name, sorted(iteritems(context))))
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
@skip_unless_lms
|
||||
class TestAccountApi(UserSettingsEventTestMixin, EmailTemplateTagMixin, RetirementTestCase):
|
||||
"""
|
||||
@@ -373,7 +371,6 @@ class TestAccountApi(UserSettingsEventTestMixin, EmailTemplateTagMixin, Retireme
|
||||
verify_event_emitted([], [{"code": "en"}, {"code": "fr"}])
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
@patch('openedx.core.djangoapps.user_api.accounts.image_helpers._PROFILE_IMAGE_SIZES', [50, 10])
|
||||
@patch.dict(
|
||||
'django.conf.settings.PROFILE_IMAGE_SIZES_MAP',
|
||||
@@ -444,7 +441,6 @@ class AccountSettingsOnCreationTest(TestCase):
|
||||
self.assertEqual(expected_user_password, user.password)
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
@pytest.mark.django_db
|
||||
def test_create_account_duplicate_email(django_db_use_migrations):
|
||||
"""
|
||||
@@ -470,7 +466,6 @@ def test_create_account_duplicate_email(django_db_use_migrations):
|
||||
create_account('different_user', password, email)
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
@ddt.ddt
|
||||
class AccountCreationActivationAndPasswordChangeTest(TestCase):
|
||||
"""
|
||||
@@ -613,7 +608,6 @@ class AccountCreationActivationAndPasswordChangeTest(TestCase):
|
||||
self.assertEqual(response.status_code, 403)
|
||||
|
||||
|
||||
@attr(shard=2)
|
||||
@ddt.ddt
|
||||
class AccountCreationUnicodeUsernameTest(TestCase):
|
||||
"""
|
||||
|
||||
@@ -22,7 +22,6 @@ class ProfileImageUrlTestCase(TestCase):
|
||||
"""
|
||||
Tests for profile image URL generation helpers.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(ProfileImageUrlTestCase, self).setUp()
|
||||
|
||||
@@ -145,7 +145,6 @@ class TestOwnUsernameAPI(CacheIsolationTestCase, UserAPITestCase):
|
||||
"""
|
||||
Unit tests for the Accounts API.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
ENABLED_CACHES = ['default']
|
||||
|
||||
@@ -204,7 +203,6 @@ class TestAccountsAPI(CacheIsolationTestCase, UserAPITestCase):
|
||||
"""
|
||||
Unit tests for the Accounts API.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
ENABLED_CACHES = ['default']
|
||||
|
||||
@@ -813,7 +811,6 @@ class TestAccountAPITransactions(TransactionTestCase):
|
||||
"""
|
||||
Tests the transactional behavior of the account API
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(TestAccountAPITransactions, self).setUp()
|
||||
|
||||
@@ -12,7 +12,6 @@ class TestCourseTagAPI(TestCase):
|
||||
"""
|
||||
Test the user service
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(TestCourseTagAPI, self).setUp()
|
||||
|
||||
@@ -27,7 +27,6 @@ from openedx.core.djangolib.testing.utils import skip_unless_lms
|
||||
@skip_unless_lms
|
||||
class EmailOptInListTest(ModuleStoreTestCase):
|
||||
"""Tests for the email opt-in list management command. """
|
||||
shard = 2
|
||||
USER_USERNAME = "test_user"
|
||||
USER_FIRST_NAME = u"Ṫëṡẗ"
|
||||
USER_LAST_NAME = u"Űśéŕ"
|
||||
|
||||
@@ -47,7 +47,6 @@ class TestPreferenceAPI(CacheIsolationTestCase):
|
||||
are not specified.
|
||||
"""
|
||||
password = "test"
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(TestPreferenceAPI, self).setUp()
|
||||
@@ -335,7 +334,6 @@ class UpdateEmailOptInTests(ModuleStoreTestCase):
|
||||
USERNAME = u'claire-underwood'
|
||||
PASSWORD = u'ṕáśśẃőŕd'
|
||||
EMAIL = u'claire+underwood@example.com'
|
||||
shard = 2
|
||||
|
||||
@ddt.data(
|
||||
# Check that a 27 year old can opt-in
|
||||
|
||||
@@ -298,7 +298,6 @@ class UserAccountUpdateTest(CacheIsolationTestCase, UrlResetMixin):
|
||||
@ddt.ddt
|
||||
class LoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMixin, ModuleStoreTestCase):
|
||||
""" Tests for the student account views that update the user's account information. """
|
||||
shard = 7
|
||||
USERNAME = "bob"
|
||||
EMAIL = "bob@example.com"
|
||||
PASSWORD = u"password"
|
||||
|
||||
@@ -21,7 +21,6 @@ class CohortingSettingsTestCase(SharedModuleStoreTestCase):
|
||||
"""
|
||||
Tests the `cohort_discussion_topics` view.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
||||
@@ -15,7 +15,6 @@ class TestJSUtils(TestCase):
|
||||
"""
|
||||
Test JS utils
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
class NoDefaultEncoding(object):
|
||||
"""
|
||||
|
||||
@@ -16,7 +16,6 @@ from openedx.core.djangolib.markup import HTML, Text, strip_all_tags_but_br
|
||||
@ddt.ddt
|
||||
class FormatHtmlTest(unittest.TestCase):
|
||||
"""Test that we can format plain strings and HTML into them properly."""
|
||||
shard = 2
|
||||
|
||||
@ddt.data(
|
||||
(u"hello", u"hello"),
|
||||
|
||||
@@ -77,7 +77,6 @@ urlpatterns = [
|
||||
@override_settings(ROOT_URLCONF=__name__)
|
||||
class OAuth2Tests(TestCase):
|
||||
"""OAuth 2.0 authentication"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(OAuth2Tests, self).setUp()
|
||||
|
||||
@@ -11,7 +11,6 @@ class TestDictExceptionsAllowDictDetails(TestCase):
|
||||
"""
|
||||
Test that standard DRF exceptions can return dictionaries in error details.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def test_drf_errors_are_not_coerced_to_strings(self):
|
||||
# Demonstrate that dictionaries in exceptions are not coerced to strings.
|
||||
|
||||
@@ -15,7 +15,6 @@ class TestTypedFileUploadParser(APITestCase):
|
||||
"""
|
||||
Tests that verify the behavior of TypedFileUploadParser
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(TestTypedFileUploadParser, self).setUp()
|
||||
|
||||
@@ -32,7 +32,6 @@ class TestCcxObject(TestObject):
|
||||
|
||||
class IsCourseStaffInstructorTests(TestCase):
|
||||
""" Test for IsCourseStaffInstructor permission class. """
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(IsCourseStaffInstructorTests, self).setUp()
|
||||
@@ -66,7 +65,6 @@ class IsCourseStaffInstructorTests(TestCase):
|
||||
|
||||
class IsMasterCourseStaffInstructorTests(TestCase):
|
||||
""" Test for IsMasterCourseStaffInstructorTests permission class. """
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(IsMasterCourseStaffInstructorTests, self).setUp()
|
||||
@@ -112,7 +110,6 @@ class IsMasterCourseStaffInstructorTests(TestCase):
|
||||
@ddt.ddt
|
||||
class IsStaffOrOwnerTests(TestCase):
|
||||
""" Tests for IsStaffOrOwner permission class. """
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(IsStaffOrOwnerTests, self).setUp()
|
||||
|
||||
@@ -22,7 +22,6 @@ class TestGatingApi(ModuleStoreTestCase, MilestonesTestCaseMixin):
|
||||
"""
|
||||
Tests for the gating API
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
MODULESTORE = TEST_DATA_SPLIT_MODULESTORE
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ class TestCourseTabApi(TestCase):
|
||||
"""
|
||||
Unit tests for the course tab plugin API
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def test_get_plugin(self):
|
||||
"""
|
||||
|
||||
@@ -10,7 +10,6 @@ from openedx.core.lib.course_tabs import CourseTabPluginManager
|
||||
|
||||
class CourseTabPluginManagerTestCase(TestCase):
|
||||
"""Test cases for CourseTabPluginManager class"""
|
||||
shard = 2
|
||||
|
||||
@patch('openedx.core.lib.course_tabs.CourseTabPluginManager.get_available_plugins')
|
||||
def test_get_tab_types(self, get_available_plugins):
|
||||
@@ -40,7 +39,6 @@ class CourseTabPluginManagerTestCase(TestCase):
|
||||
|
||||
class KeyCheckerTestCase(TestCase):
|
||||
"""Test cases for KeyChecker class"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(KeyCheckerTestCase, self).setUp()
|
||||
@@ -59,7 +57,6 @@ class KeyCheckerTestCase(TestCase):
|
||||
|
||||
class NeedNameTestCase(TestCase):
|
||||
"""Test cases for NeedName validator"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(NeedNameTestCase, self).setUp()
|
||||
|
||||
@@ -15,7 +15,6 @@ from ..courses import course_image_url
|
||||
@ddt.ddt
|
||||
class CourseImageTestCase(ModuleStoreTestCase):
|
||||
"""Tests for course image URLs."""
|
||||
shard = 2
|
||||
|
||||
def verify_url(self, expected_url, actual_url):
|
||||
"""
|
||||
|
||||
@@ -23,7 +23,6 @@ TEST_API_URL = 'http://www-internal.example.com/api'
|
||||
class TestGetEdxApiData(CatalogIntegrationMixin, CredentialsApiConfigMixin, CacheIsolationTestCase):
|
||||
"""Tests for edX API data retrieval utility."""
|
||||
ENABLED_CACHES = ['default']
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
super(TestGetEdxApiData, self).setUp()
|
||||
|
||||
@@ -12,7 +12,6 @@ class TestGraphTraversals(TestCase):
|
||||
"""
|
||||
Test Class for graph traversal generator functions.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
# Creates a test graph with the following disconnected
|
||||
|
||||
@@ -37,7 +37,6 @@ class TestXblockUtils(SharedModuleStoreTestCase):
|
||||
"""
|
||||
Tests for xblock utility functions.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
||||
@@ -59,7 +59,6 @@ class DiscussionXBlockImportExportTests(TestCase):
|
||||
Import and export tests
|
||||
"""
|
||||
DISCUSSION_XBLOCK_LOCATION = "openedx.core.lib.xblock_builtin.xblock_discussion.xblock_discussion.DiscussionXBlock"
|
||||
shard = 2
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
|
||||
@@ -64,7 +64,6 @@ class JournalIndexViewTest(SiteMixin, ModuleStoreTestCase):
|
||||
"""
|
||||
Tests for Journals Listing in Marketing Pages.
|
||||
"""
|
||||
shard = 1
|
||||
|
||||
def setUp(self):
|
||||
super(JournalIndexViewTest, self).setUp()
|
||||
|
||||
@@ -139,7 +139,6 @@ class TestHinterFunctions(TestCrowdsourceHinter):
|
||||
Tests cover the basic process of receiving a hint, adding a new hint,
|
||||
and rating/reporting hints.
|
||||
"""
|
||||
shard = 6
|
||||
|
||||
def test_get_hint_with_no_hints(self):
|
||||
"""
|
||||
|
||||
@@ -16,7 +16,6 @@ from ddt import data, ddt
|
||||
from lms.djangoapps.courseware.tests.factories import GlobalStaffFactory
|
||||
from lms.djangoapps.courseware.tests.helpers import LoginEnrollmentTestCase
|
||||
from six import text_type
|
||||
from openedx.core.lib.tests import attr
|
||||
from openedx.core.lib.url_utils import quote_slashes
|
||||
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
@@ -196,7 +195,6 @@ class TestRecommender(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
|
||||
self.assert_request_status_code(200, self.course_url)
|
||||
|
||||
|
||||
@attr(shard=6)
|
||||
class TestRecommenderCreateFromEmpty(TestRecommender):
|
||||
"""
|
||||
Check whether we can add resources to an empty database correctly
|
||||
@@ -223,7 +221,6 @@ class TestRecommenderCreateFromEmpty(TestRecommender):
|
||||
self.assert_request_status_code(200, self.course_url)
|
||||
|
||||
|
||||
@attr(shard=6)
|
||||
class TestRecommenderResourceBase(TestRecommender):
|
||||
"""Base helper class for tests with resources."""
|
||||
def setUp(self):
|
||||
@@ -256,7 +253,6 @@ class TestRecommenderResourceBase(TestRecommender):
|
||||
return resource
|
||||
|
||||
|
||||
@attr(shard=6)
|
||||
class TestRecommenderWithResources(TestRecommenderResourceBase):
|
||||
"""
|
||||
Check whether we can add/edit/flag/export resources correctly
|
||||
@@ -421,7 +417,6 @@ class TestRecommenderWithResources(TestRecommenderResourceBase):
|
||||
self.assert_request_status_code(200, self.course_url)
|
||||
|
||||
|
||||
@attr(shard=6)
|
||||
@ddt
|
||||
class TestRecommenderVoteWithResources(TestRecommenderResourceBase):
|
||||
"""
|
||||
@@ -535,7 +530,6 @@ class TestRecommenderVoteWithResources(TestRecommenderResourceBase):
|
||||
self.check_event_response_by_key('handle_vote', resource, 'newVotes', test_case['new_votes'])
|
||||
|
||||
|
||||
@attr(shard=6)
|
||||
@ddt
|
||||
class TestRecommenderStaffFeedbackWithResources(TestRecommenderResourceBase):
|
||||
"""
|
||||
@@ -630,7 +624,6 @@ class TestRecommenderStaffFeedbackWithResources(TestRecommenderResourceBase):
|
||||
self.check_event_response_by_http_status(test_case['handler'], resource, test_case['status'])
|
||||
|
||||
|
||||
@attr(shard=6)
|
||||
@ddt
|
||||
class TestRecommenderFileUploading(TestRecommender):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user