Remove lms pytest shards
This commit is contained in:
@@ -151,7 +151,6 @@ class TestUserBadgeAssertionsByClass(UserAssertionTestCase):
|
||||
"""
|
||||
Test the Badge Assertions view with the badge class filter.
|
||||
"""
|
||||
shard = 3
|
||||
|
||||
@unpack
|
||||
@data((False, False), (True, False), (True, True))
|
||||
|
||||
@@ -35,7 +35,6 @@ class BadgrBackendTestCase(ModuleStoreTestCase, EventTrackingTestCase):
|
||||
"""
|
||||
Tests the BadgeHandler object
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
|
||||
@@ -13,7 +13,6 @@ class CourseCompleteTestCase(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests for the course completion helper functions.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(CourseCompleteTestCase, self).setUp()
|
||||
|
||||
@@ -21,7 +21,6 @@ class CourseEnrollmentBadgeTest(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests the event which awards badges based on number of courses a user is enrolled in.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(CourseEnrollmentBadgeTest, self).setUp()
|
||||
@@ -72,7 +71,6 @@ class CourseCompletionBadgeTest(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests the event which awards badges based on the number of courses completed.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(CourseCompletionBadgeTest, self).setUp()
|
||||
@@ -127,7 +125,6 @@ class CourseGroupBadgeTest(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests the event which awards badges when a user completes a set of courses.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(CourseGroupBadgeTest, self).setUp()
|
||||
|
||||
@@ -36,7 +36,6 @@ class BadgeImageConfigurationTest(TestCase):
|
||||
"""
|
||||
Test the validation features of BadgeImageConfiguration.
|
||||
"""
|
||||
shard = 1
|
||||
|
||||
def tearDown(self):
|
||||
tmp_path = Path(TEST_DATA_ROOT / 'course_complete_badges')
|
||||
|
||||
@@ -14,7 +14,6 @@ from edxmako.shortcuts import marketing_link
|
||||
|
||||
class TestHeader(TestCase):
|
||||
"""Test API end-point for retrieving the header. """
|
||||
shard = 4
|
||||
|
||||
def test_cdn_urls_for_logo(self):
|
||||
# Ordinarily, we'd use `override_settings()` to override STATIC_URL,
|
||||
@@ -42,7 +41,6 @@ class TestHeader(TestCase):
|
||||
|
||||
|
||||
class TestFooter(TestCase):
|
||||
shard = 4
|
||||
maxDiff = None
|
||||
"""Test retrieving the footer. """
|
||||
@mock.patch.dict('django.conf.settings.FEATURES', {'ENABLE_MKTG_SITE': True})
|
||||
|
||||
@@ -11,7 +11,6 @@ class BrandingInfoConfigTest(TestCase):
|
||||
"""
|
||||
Test the BrandingInfoConfig model.
|
||||
"""
|
||||
shard = 1
|
||||
|
||||
def setUp(self):
|
||||
super(BrandingInfoConfigTest, self).setUp()
|
||||
|
||||
@@ -17,7 +17,6 @@ from branding.views import index
|
||||
from courseware.tests.helpers import LoginEnrollmentTestCase
|
||||
from edxmako.shortcuts import render_to_response
|
||||
from openedx.core.djangoapps.site_configuration.tests.mixins import SiteMixin
|
||||
from openedx.core.lib.tests import attr
|
||||
from util.milestones_helpers import set_prerequisite_courses
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
@@ -37,7 +36,6 @@ def mock_render_to_response(*args, **kwargs):
|
||||
RENDER_MOCK = Mock(side_effect=mock_render_to_response)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class AnonymousIndexPageTest(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests that anonymous users can access the '/' page, Need courses with start date
|
||||
@@ -109,7 +107,6 @@ class AnonymousIndexPageTest(ModuleStoreTestCase):
|
||||
self.assertEqual(response._headers.get("location")[1], "/login") # pylint: disable=protected-access
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class PreRequisiteCourseCatalog(ModuleStoreTestCase, LoginEnrollmentTestCase, MilestonesTestCaseMixin):
|
||||
"""
|
||||
Test to simulate and verify fix for disappearing courses in
|
||||
@@ -155,7 +152,6 @@ class PreRequisiteCourseCatalog(ModuleStoreTestCase, LoginEnrollmentTestCase, Mi
|
||||
self.assertIn('course that has pre requisite', resp.content)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class IndexPageCourseCardsSortingTests(ModuleStoreTestCase):
|
||||
"""
|
||||
Test for Index page course cards sorting
|
||||
@@ -290,7 +286,6 @@ class IndexPageCourseCardsSortingTests(ModuleStoreTestCase):
|
||||
self.assertEqual(context['courses'][2].id, self.course_with_default_start_date.id)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class IndexPageProgramsTests(SiteMixin, ModuleStoreTestCase):
|
||||
"""
|
||||
Tests for Programs List in Marketing Pages.
|
||||
|
||||
@@ -22,7 +22,6 @@ from student.tests.factories import UserFactory
|
||||
@ddt.ddt
|
||||
class TestFooter(CacheIsolationTestCase):
|
||||
"""Test API end-point for retrieving the footer. """
|
||||
shard = 4
|
||||
|
||||
@ddt.data("*/*", "text/html", "application/json")
|
||||
def test_feature_flag(self, accepts):
|
||||
@@ -280,7 +279,6 @@ class TestFooter(CacheIsolationTestCase):
|
||||
|
||||
class TestIndex(SiteMixin, TestCase):
|
||||
""" Test the index view """
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
""" Set up a user """
|
||||
|
||||
@@ -27,7 +27,6 @@ class TestOptoutCourseEmails(ModuleStoreTestCase):
|
||||
"""
|
||||
Test that optouts are referenced in sending course email.
|
||||
"""
|
||||
shard = 1
|
||||
|
||||
def setUp(self):
|
||||
super(TestOptoutCourseEmails, self).setUp()
|
||||
@@ -122,7 +121,6 @@ class TestACEOptoutCourseEmails(ModuleStoreTestCase):
|
||||
"""
|
||||
Test that optouts are referenced in sending course email.
|
||||
"""
|
||||
shard = 1
|
||||
|
||||
def setUp(self):
|
||||
super(TestACEOptoutCourseEmails, self).setUp()
|
||||
|
||||
@@ -25,7 +25,6 @@ from enrollment.api import update_enrollment
|
||||
from lms.djangoapps.instructor_task.subtasks import update_subtask_status
|
||||
from openedx.core.djangoapps.course_groups.cohorts import add_user_to_cohort
|
||||
from openedx.core.djangoapps.course_groups.models import CourseCohort
|
||||
from openedx.core.lib.tests import attr
|
||||
from student.models import CourseEnrollment
|
||||
from student.roles import CourseStaffRole
|
||||
from student.tests.factories import CourseEnrollmentFactory, UserFactory
|
||||
@@ -168,7 +167,6 @@ class SendEmailWithMockedUgettextMixin(object):
|
||||
return mail.outbox[0]
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@patch.dict(settings.FEATURES, {'ENABLE_INSTRUCTOR_EMAIL': True, 'REQUIRE_COURSE_EMAIL_AUTH': False})
|
||||
@ddt.ddt
|
||||
class LocalizedFromAddressPlatformLangTestCase(SendEmailWithMockedUgettextMixin, EmailSendFromDashboardTestCase):
|
||||
@@ -194,7 +192,6 @@ class LocalizedFromAddressPlatformLangTestCase(SendEmailWithMockedUgettextMixin,
|
||||
self.assertRegexpMatches(message.from_email, '@EO .* Course Staff@')
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@patch.dict(settings.FEATURES, {'ENABLE_INSTRUCTOR_EMAIL': True, 'REQUIRE_COURSE_EMAIL_AUTH': False})
|
||||
@ddt.ddt
|
||||
class LocalizedFromAddressCourseLangTestCase(SendEmailWithMockedUgettextMixin, EmailSendFromDashboardTestCase):
|
||||
@@ -227,7 +224,6 @@ class LocalizedFromAddressCourseLangTestCase(SendEmailWithMockedUgettextMixin, E
|
||||
self.assertRegexpMatches(message.from_email, '@AR .* Course Staff@')
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@patch('bulk_email.models.html_to_text', Mock(return_value='Mocking CourseEmail.text_message', autospec=True))
|
||||
class TestEmailSendFromDashboardMockedHtmlToText(EmailSendFromDashboardTestCase):
|
||||
"""
|
||||
@@ -598,7 +594,6 @@ class TestEmailSendFromDashboardMockedHtmlToText(EmailSendFromDashboardTestCase)
|
||||
self.assertItemsEqual(outbox_contents, should_send_contents)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@skipIf(os.environ.get("TRAVIS") == 'true', "Skip this test in Travis CI.")
|
||||
class TestEmailSendFromDashboard(EmailSendFromDashboardTestCase):
|
||||
"""
|
||||
|
||||
@@ -43,7 +43,6 @@ class TestEmailErrors(ModuleStoreTestCase):
|
||||
"""
|
||||
Test that errors from sending email are handled properly.
|
||||
"""
|
||||
shard = 1
|
||||
|
||||
ENABLED_CACHES = ['default', 'mongo_metadata_inheritance', 'loc_cache']
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ from xmodule.modulestore.tests.factories import CourseFactory
|
||||
|
||||
class CourseAuthorizationFormTest(ModuleStoreTestCase):
|
||||
"""Test the CourseAuthorizationAdminForm form for Mongo-backed courses."""
|
||||
shard = 1
|
||||
|
||||
def setUp(self):
|
||||
super(CourseAuthorizationFormTest, self).setUp()
|
||||
|
||||
@@ -21,14 +21,12 @@ from bulk_email.models import (
|
||||
)
|
||||
from course_modes.models import CourseMode
|
||||
from openedx.core.djangoapps.course_groups.models import CourseCohort
|
||||
from openedx.core.lib.tests import attr
|
||||
from student.tests.factories import UserFactory
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
@attr(shard=1)
|
||||
@patch('bulk_email.models.html_to_text', Mock(return_value='Mocking CourseEmail.text_message', autospec=True))
|
||||
class CourseEmailTest(ModuleStoreTestCase):
|
||||
"""Test the CourseEmail model."""
|
||||
@@ -146,7 +144,6 @@ class CourseEmailTest(ModuleStoreTestCase):
|
||||
self.assertEqual(target.long_display(), 'Cohort: test cohort')
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class NoCourseEmailTemplateTest(TestCase):
|
||||
"""Test the CourseEmailTemplate model without loading the template data."""
|
||||
|
||||
@@ -155,7 +152,6 @@ class NoCourseEmailTemplateTest(TestCase):
|
||||
CourseEmailTemplate.get_template()
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class CourseEmailTemplateTest(TestCase):
|
||||
"""Test the CourseEmailTemplate model."""
|
||||
|
||||
@@ -254,7 +250,6 @@ class CourseEmailTemplateTest(TestCase):
|
||||
self.assertIn(context['name'], message)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class CourseAuthorizationTest(TestCase):
|
||||
"""Test the CourseAuthorization model."""
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ class TestOptoutCourseEmailsBySignal(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests that the force_optout_all signal receiver opts the user out of course emails
|
||||
"""
|
||||
shard = 1
|
||||
|
||||
def setUp(self):
|
||||
super(TestOptoutCourseEmailsBySignal, self).setUp()
|
||||
|
||||
@@ -76,7 +76,6 @@ def my_update_subtask_status(entry_id, current_task_id, new_subtask_status):
|
||||
@patch('bulk_email.models.html_to_text', Mock(return_value='Mocking CourseEmail.text_message', autospec=True))
|
||||
class TestBulkEmailInstructorTask(InstructorTaskCourseTestCase):
|
||||
"""Tests instructor task that send bulk email."""
|
||||
shard = 5
|
||||
|
||||
def setUp(self):
|
||||
super(TestBulkEmailInstructorTask, self).setUp()
|
||||
|
||||
@@ -34,7 +34,6 @@ class BulkEnrollmentTest(ModuleStoreTestCase, LoginEnrollmentTestCase, APITestCa
|
||||
"""
|
||||
Test the bulk enrollment endpoint
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
USERNAME = "Bob"
|
||||
EMAIL = "bob@example.com"
|
||||
|
||||
@@ -166,7 +166,6 @@ class CcxListTest(CcxRestApiTest):
|
||||
Test for the CCX REST APIs
|
||||
"""
|
||||
ENABLED_SIGNALS = ['course_published']
|
||||
shard = 9
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
@@ -877,7 +876,6 @@ class CcxDetailTest(CcxRestApiTest):
|
||||
Test for the CCX REST APIs
|
||||
"""
|
||||
ENABLED_SIGNALS = ['course_published']
|
||||
shard = 9
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
|
||||
@@ -17,7 +17,6 @@ from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
class TestCCXModulestoreWrapper(SharedModuleStoreTestCase):
|
||||
"""tests for a modulestore wrapped by CCXModulestoreWrapper
|
||||
"""
|
||||
shard = 7
|
||||
MODULESTORE = TEST_DATA_SPLIT_MODULESTORE
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -53,7 +53,6 @@ class FieldOverridePerformanceTestCase(FieldOverrideTestMixin, ProceduralCourseT
|
||||
__test__ = False
|
||||
# Tell Django to clean out all databases, not just default
|
||||
multi_db = True
|
||||
shard = 7
|
||||
|
||||
# TEST_DATA must be overridden by subclasses
|
||||
TEST_DATA = None
|
||||
|
||||
@@ -22,7 +22,6 @@ class TestCCX(ModuleStoreTestCase):
|
||||
"""
|
||||
|
||||
MODULESTORE = TEST_DATA_SPLIT_MODULESTORE
|
||||
shard = 7
|
||||
|
||||
def setUp(self):
|
||||
"""common setup for all tests"""
|
||||
|
||||
@@ -31,7 +31,6 @@ class TestFieldOverrides(FieldOverrideTestMixin, SharedModuleStoreTestCase):
|
||||
Make sure field overrides behave in the expected manner.
|
||||
"""
|
||||
MODULESTORE = TEST_DATA_SPLIT_MODULESTORE
|
||||
shard = 7
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
||||
@@ -28,7 +28,6 @@ class TestSendCCXCoursePublished(ModuleStoreTestCase):
|
||||
"""
|
||||
Unit tests for the send ccx course published task
|
||||
"""
|
||||
shard = 7
|
||||
MODULESTORE = TEST_DATA_SPLIT_MODULESTORE
|
||||
|
||||
ENABLED_SIGNALS = ['course_published']
|
||||
|
||||
@@ -22,7 +22,6 @@ from xmodule.modulestore.tests.factories import CourseFactory
|
||||
class TestGetCCXFromCCXLocator(ModuleStoreTestCase):
|
||||
"""Verify that get_ccx_from_ccx_locator functions properly"""
|
||||
MODULESTORE = TEST_DATA_SPLIT_MODULESTORE
|
||||
shard = 7
|
||||
|
||||
def setUp(self):
|
||||
"""Set up a course, coach, ccx and user"""
|
||||
|
||||
@@ -37,7 +37,6 @@ from lms.djangoapps.ccx.views import get_date
|
||||
from lms.djangoapps.grades.tasks import compute_all_grades_for_course
|
||||
from lms.djangoapps.instructor.access import allow_access, list_with_level
|
||||
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
|
||||
from openedx.core.lib.tests import attr
|
||||
from student.models import CourseEnrollment, CourseEnrollmentAllowed
|
||||
from student.roles import CourseCcxCoachRole, CourseInstructorRole, CourseStaffRole
|
||||
from student.tests.factories import AdminFactory, CourseEnrollmentFactory, UserFactory
|
||||
@@ -167,7 +166,6 @@ class TestAdminAccessCoachDashboard(CcxTestCase, LoginEnrollmentTestCase):
|
||||
self.assertEqual(response.status_code, 403)
|
||||
|
||||
|
||||
@attr(shard=7)
|
||||
@override_settings(
|
||||
XBLOCK_FIELD_DATA_WRAPPERS=['lms.djangoapps.courseware.field_overrides:OverrideModulestoreFieldData.wrap'],
|
||||
MODULESTORE_FIELD_OVERRIDE_PROVIDERS=['ccx.overrides.CustomCoursesForEdxOverrideProvider'],
|
||||
@@ -282,7 +280,6 @@ class TestCCXProgressChanges(CcxTestCase, LoginEnrollmentTestCase):
|
||||
self.assert_progress_summary(ccx_course_key, due)
|
||||
|
||||
|
||||
@attr(shard=7)
|
||||
@override_settings(
|
||||
XBLOCK_FIELD_DATA_WRAPPERS=['lms.djangoapps.courseware.field_overrides:OverrideModulestoreFieldData.wrap'],
|
||||
MODULESTORE_FIELD_OVERRIDE_PROVIDERS=['ccx.overrides.CustomCoursesForEdxOverrideProvider'],
|
||||
@@ -839,7 +836,6 @@ class TestCoachDashboard(CcxTestCase, LoginEnrollmentTestCase):
|
||||
)
|
||||
|
||||
|
||||
@attr(shard=7)
|
||||
class TestCoachDashboardSchedule(CcxTestCase, LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
"""
|
||||
Tests of the CCX Coach Dashboard which need to modify the course content.
|
||||
@@ -981,7 +977,6 @@ def patched_get_children(self, usage_key_filter=None):
|
||||
return list(iter_children())
|
||||
|
||||
|
||||
@attr(shard=7)
|
||||
@override_settings(
|
||||
XBLOCK_FIELD_DATA_WRAPPERS=['lms.djangoapps.courseware.field_overrides:OverrideModulestoreFieldData.wrap'],
|
||||
MODULESTORE_FIELD_OVERRIDE_PROVIDERS=['ccx.overrides.CustomCoursesForEdxOverrideProvider'],
|
||||
|
||||
@@ -25,7 +25,6 @@ class CertificatesRestApiTest(AuthAndScopesTestMixin, SharedModuleStoreTestCase,
|
||||
"""
|
||||
Test for the Certificates REST APIs
|
||||
"""
|
||||
shard = 4
|
||||
now = timezone.now()
|
||||
default_scopes = CertificatesDetailView.required_scopes
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ from course_modes.tests.factories import CourseModeFactory
|
||||
from courseware.tests.factories import GlobalStaffFactory
|
||||
from lms.djangoapps.grades.tests.utils import mock_passing_grade
|
||||
from microsite_configuration import microsite
|
||||
from openedx.core.lib.tests import attr
|
||||
from student.models import CourseEnrollment
|
||||
from student.tests.factories import UserFactory
|
||||
from util.testing import EventTestMixin
|
||||
@@ -83,7 +82,6 @@ class WebCertificateTestMixin(object):
|
||||
self.store.update_item(self.course, self.user.id)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@ddt.ddt
|
||||
class CertificateDownloadableStatusTests(WebCertificateTestMixin, ModuleStoreTestCase):
|
||||
"""Tests for the `certificate_downloadable_status` helper function. """
|
||||
@@ -234,7 +232,6 @@ class CertificateDownloadableStatusTests(WebCertificateTestMixin, ModuleStoreTes
|
||||
)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@ddt.ddt
|
||||
class CertificateisInvalid(WebCertificateTestMixin, ModuleStoreTestCase):
|
||||
"""Tests for the `is_certificate_invalid` helper function. """
|
||||
@@ -346,7 +343,6 @@ class CertificateisInvalid(WebCertificateTestMixin, ModuleStoreTestCase):
|
||||
)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class CertificateGetTests(SharedModuleStoreTestCase):
|
||||
"""Tests for the `test_get_certificate_for_user` helper function. """
|
||||
now = timezone.now()
|
||||
@@ -514,7 +510,6 @@ class CertificateGetTests(SharedModuleStoreTestCase):
|
||||
)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@override_settings(CERT_QUEUE='certificates')
|
||||
class GenerateUserCertificatesTest(EventTestMixin, WebCertificateTestMixin, ModuleStoreTestCase):
|
||||
"""Tests for generating certificates for students. """
|
||||
@@ -610,7 +605,6 @@ class GenerateUserCertificatesTest(EventTestMixin, WebCertificateTestMixin, Modu
|
||||
self.assertEqual(url, "")
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@ddt.ddt
|
||||
class CertificateGenerationEnabledTest(EventTestMixin, TestCase):
|
||||
"""Test enabling/disabling self-generated certificates for a course. """
|
||||
@@ -678,7 +672,6 @@ class CertificateGenerationEnabledTest(EventTestMixin, TestCase):
|
||||
self.assertEqual(expect_enabled, actual_enabled)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class GenerateExampleCertificatesTest(TestCase):
|
||||
"""Test generation of example certificates. """
|
||||
|
||||
@@ -766,7 +759,6 @@ def set_microsite(domain):
|
||||
|
||||
|
||||
@override_settings(FEATURES=FEATURES_WITH_CERTS_ENABLED)
|
||||
@attr(shard=1)
|
||||
class CertificatesBrandingTest(TestCase):
|
||||
"""Test certificates branding. """
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ from badges.tests.factories import BadgeAssertionFactory, CourseCompleteImageCon
|
||||
from lms.djangoapps.certificates.models import CertificateStatuses, GeneratedCertificate
|
||||
from course_modes.models import CourseMode
|
||||
from lms.djangoapps.grades.tests.utils import mock_passing_grade
|
||||
from openedx.core.lib.tests import attr
|
||||
from student.tests.factories import CourseEnrollmentFactory, UserFactory
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, check_mongo_calls
|
||||
@@ -60,7 +59,6 @@ class CertificateManagementTest(ModuleStoreTestCase):
|
||||
self.assertEqual(cert.status, expected_status)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@ddt.ddt
|
||||
class ResubmitErrorCertificatesTest(CertificateManagementTest):
|
||||
"""Tests for the resubmit_error_certificates management command. """
|
||||
@@ -149,7 +147,6 @@ class ResubmitErrorCertificatesTest(CertificateManagementTest):
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
@attr(shard=1)
|
||||
class RegenerateCertificatesTest(CertificateManagementTest):
|
||||
"""
|
||||
Tests for regenerating certificates.
|
||||
@@ -219,7 +216,6 @@ class RegenerateCertificatesTest(CertificateManagementTest):
|
||||
self.assertFalse(mock_send_to_queue.called)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class UngenerateCertificatesTest(CertificateManagementTest):
|
||||
"""
|
||||
Tests for generating certificates.
|
||||
|
||||
@@ -12,7 +12,6 @@ from student.tests.factories import UserFactory
|
||||
|
||||
class CreateFakeCertTest(TestCase):
|
||||
"""Tests for the create_fake_certs management command. """
|
||||
shard = 1
|
||||
USERNAME = "test"
|
||||
COURSE_KEY = CourseLocator(org='edX', course='DemoX', run='Demo_Course')
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ from lms.djangoapps.certificates.models import (
|
||||
)
|
||||
from lms.djangoapps.certificates.tests.factories import CertificateInvalidationFactory, GeneratedCertificateFactory
|
||||
from lms.djangoapps.instructor_task.tests.factories import InstructorTaskFactory
|
||||
from openedx.core.lib.tests import attr
|
||||
from student.tests.factories import AdminFactory, UserFactory
|
||||
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
@@ -37,7 +36,6 @@ PLATFORM_ROOT = TEST_DIR.parent.parent.parent.parent
|
||||
TEST_DATA_ROOT = PLATFORM_ROOT / TEST_DATA_DIR
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class ExampleCertificateTest(TestCase):
|
||||
"""Tests for the ExampleCertificate model. """
|
||||
|
||||
@@ -103,7 +101,6 @@ class ExampleCertificateTest(TestCase):
|
||||
self.assertIs(result, None)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class CertificateHtmlViewConfigurationTest(TestCase):
|
||||
"""
|
||||
Test the CertificateHtmlViewConfiguration model.
|
||||
@@ -170,7 +167,6 @@ class CertificateHtmlViewConfigurationTest(TestCase):
|
||||
self.assertEquals(self.config.get_config(), {})
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class CertificateTemplateAssetTest(TestCase):
|
||||
"""
|
||||
Test Assets are uploading/saving successfully for CertificateTemplateAsset.
|
||||
@@ -198,7 +194,6 @@ class CertificateTemplateAssetTest(TestCase):
|
||||
self.assertEqual(certificate_template_asset.asset, 'certificate_template_assets/1/picture2.jpg')
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class EligibleCertificateManagerTest(SharedModuleStoreTestCase):
|
||||
"""
|
||||
Test the GeneratedCertificate model's object manager for filtering
|
||||
@@ -237,7 +232,6 @@ class EligibleCertificateManagerTest(SharedModuleStoreTestCase):
|
||||
)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@ddt.ddt
|
||||
class TestCertificateGenerationHistory(TestCase):
|
||||
"""
|
||||
@@ -303,7 +297,6 @@ class TestCertificateGenerationHistory(TestCase):
|
||||
)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class CertificateInvalidationTest(SharedModuleStoreTestCase):
|
||||
"""
|
||||
Test for the Certificate Invalidation model.
|
||||
|
||||
@@ -33,7 +33,6 @@ from xmodule.modulestore.tests.factories import CourseFactory
|
||||
@override_settings(CERT_QUEUE='certificates')
|
||||
class XQueueCertInterfaceAddCertificateTest(ModuleStoreTestCase):
|
||||
"""Test the "add to queue" operation of the XQueue interface. """
|
||||
shard = 1
|
||||
|
||||
def setUp(self):
|
||||
super(XQueueCertInterfaceAddCertificateTest, self).setUp()
|
||||
@@ -281,7 +280,6 @@ class XQueueCertInterfaceAddCertificateTest(ModuleStoreTestCase):
|
||||
@override_settings(CERT_QUEUE='certificates')
|
||||
class XQueueCertInterfaceExampleCertificateTest(TestCase):
|
||||
"""Tests for the XQueue interface for certificate generation. """
|
||||
shard = 1
|
||||
|
||||
COURSE_KEY = CourseLocator(org='test', course='test', run='test')
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ class CertificateServiceTests(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests for the Certificate service
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(CertificateServiceTests, self).setUp()
|
||||
|
||||
@@ -26,7 +26,6 @@ class SelfGeneratedCertsSignalTest(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests for enabling/disabling self-generated certificates according to course-pacing.
|
||||
"""
|
||||
shard = 4
|
||||
ENABLED_SIGNALS = ['course_published']
|
||||
|
||||
def setUp(self):
|
||||
@@ -54,7 +53,6 @@ class WhitelistGeneratedCertificatesTest(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests for whitelisted student auto-certificate generation
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(WhitelistGeneratedCertificatesTest, self).setUp()
|
||||
@@ -135,7 +133,6 @@ class PassingGradeCertsTest(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests for certificate generation task firing on passing grade receipt
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(PassingGradeCertsTest, self).setUp()
|
||||
@@ -229,7 +226,6 @@ class FailingGradeCertsTest(ModuleStoreTestCase):
|
||||
and that the signal has no effect on the cert status if the cert has a non-passing
|
||||
status
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(FailingGradeCertsTest, self).setUp()
|
||||
@@ -285,7 +281,6 @@ class LearnerTrackChangeCertsTest(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests for certificate generation task firing on learner verification
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(LearnerTrackChangeCertsTest, self).setUp()
|
||||
@@ -358,7 +353,6 @@ class CertificateGenerationTaskTest(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests for certificate generation task.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(CertificateGenerationTaskTest, self).setUp()
|
||||
|
||||
@@ -26,7 +26,6 @@ class CertificateSupportTestCase(ModuleStoreTestCase):
|
||||
"""
|
||||
Base class for tests of the certificate support views.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
SUPPORT_USERNAME = "support"
|
||||
SUPPORT_EMAIL = "support@example.com"
|
||||
@@ -92,7 +91,6 @@ class CertificateSearchTests(CertificateSupportTestCase):
|
||||
"""
|
||||
Tests for the certificate search end-point used by the support team.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
@@ -229,7 +227,6 @@ class CertificateRegenerateTests(CertificateSupportTestCase):
|
||||
"""
|
||||
Tests for the certificate regeneration end-point used by the support team.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
@@ -412,7 +409,6 @@ class CertificateGenerateTests(CertificateSupportTestCase):
|
||||
"""
|
||||
Tests for the certificate generation end-point used by the support team.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
|
||||
@@ -10,7 +10,6 @@ from student.tests.factories import UserFactory
|
||||
|
||||
@ddt.ddt
|
||||
class GenerateUserCertificateTest(TestCase):
|
||||
shard = 4
|
||||
|
||||
@patch('lms.djangoapps.certificates.tasks.generate_user_certificates')
|
||||
@patch('lms.djangoapps.certificates.tasks.User.objects.get')
|
||||
|
||||
@@ -39,7 +39,6 @@ FEATURES_WITH_CUSTOM_CERTS_ENABLED.update(FEATURES_WITH_CERTS_ENABLED)
|
||||
@ddt.ddt
|
||||
class UpdateExampleCertificateViewTest(CacheIsolationTestCase):
|
||||
"""Tests for the XQueue callback that updates example certificates. """
|
||||
shard = 1
|
||||
|
||||
COURSE_KEY = CourseLocator(org='test', course='test', run='test')
|
||||
|
||||
@@ -184,7 +183,6 @@ class MicrositeCertificatesViewsTests(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests for the microsite certificates web/html views
|
||||
"""
|
||||
shard = 1
|
||||
|
||||
def setUp(self):
|
||||
super(MicrositeCertificatesViewsTests, self).setUp()
|
||||
|
||||
@@ -246,7 +246,6 @@ class CertificatesViewsTests(CommonCertificatesTestCase, CacheIsolationTestCase)
|
||||
"""
|
||||
Tests for the certificates web/html views
|
||||
"""
|
||||
shard = 1
|
||||
|
||||
def setUp(self):
|
||||
super(CertificatesViewsTests, self).setUp()
|
||||
@@ -1715,7 +1714,6 @@ class CertificateEventTests(CommonCertificatesTestCase, EventTrackingTestCase):
|
||||
"""
|
||||
Test events emitted by certificate handling.
|
||||
"""
|
||||
shard = 1
|
||||
|
||||
@override_settings(FEATURES=FEATURES_WITH_CERTS_ENABLED)
|
||||
def test_certificate_evidence_event_emitted(self):
|
||||
|
||||
@@ -28,7 +28,6 @@ class CertificatesModelTest(ModuleStoreTestCase, MilestonesTestCaseMixin):
|
||||
"""
|
||||
Tests for the GeneratedCertificate model
|
||||
"""
|
||||
shard = 1
|
||||
|
||||
def setUp(self):
|
||||
super(CertificatesModelTest, self).setUp()
|
||||
|
||||
@@ -35,7 +35,6 @@ class TestGetProblemGradeDistribution(SharedModuleStoreTestCase):
|
||||
"""
|
||||
Tests related to class_dashboard/dashboard_data.py
|
||||
"""
|
||||
shard = 6
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
||||
@@ -17,7 +17,6 @@ class TestViews(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests related to class_dashboard/views.py
|
||||
"""
|
||||
shard = 1
|
||||
|
||||
def setUp(self):
|
||||
super(TestViews, self).setUp()
|
||||
|
||||
@@ -39,7 +39,6 @@ class BasketsViewTests(EnrollmentEventTestMixin, UserMixin, ModuleStoreTestCase)
|
||||
"""
|
||||
Tests for the commerce Baskets view.
|
||||
"""
|
||||
shard = 1
|
||||
|
||||
def _post_to_view(self, course_id=None, marketing_email_opt_in=False, include_utm_cookie=False):
|
||||
"""
|
||||
@@ -284,7 +283,6 @@ class BasketOrderViewTests(UserMixin, TestCase):
|
||||
view_name = 'commerce_api:v0:baskets:retrieve_order'
|
||||
MOCK_ORDER = {'number': 1}
|
||||
path = reverse_lazy(view_name, kwargs={'basket_id': 1})
|
||||
shard = 1
|
||||
|
||||
def setUp(self):
|
||||
super(BasketOrderViewTests, self).setUp()
|
||||
|
||||
@@ -10,7 +10,6 @@ from ..models import Course
|
||||
@ddt.ddt
|
||||
class CourseTests(TestCase):
|
||||
""" Tests for Course model. """
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(CourseTests, self).setUp()
|
||||
|
||||
@@ -6,7 +6,6 @@ from ..serializers import serializers, validate_course_id
|
||||
|
||||
class CourseValidatorTests(TestCase):
|
||||
""" Tests for Course Validator method. """
|
||||
shard = 4
|
||||
|
||||
def test_validate_course_id_with_non_existent_course(self):
|
||||
""" Verify a validator checking non-existent courses."""
|
||||
|
||||
@@ -109,7 +109,6 @@ class CourseRetrieveUpdateViewTests(CourseApiViewTestMixin, ModuleStoreTestCase)
|
||||
NOW: datetime.now(),
|
||||
None: None,
|
||||
}
|
||||
shard = 3
|
||||
|
||||
def setUp(self):
|
||||
super(CourseRetrieveUpdateViewTests, self).setUp()
|
||||
@@ -398,7 +397,6 @@ class OrderViewTests(UserMixin, TestCase):
|
||||
ORDER_NUMBER = 'EDX-100001'
|
||||
MOCK_ORDER = {'number': ORDER_NUMBER}
|
||||
path = reverse_lazy(view_name, kwargs={'number': ORDER_NUMBER})
|
||||
shard = 1
|
||||
|
||||
def setUp(self):
|
||||
super(OrderViewTests, self).setUp()
|
||||
|
||||
@@ -11,7 +11,6 @@ class TestCommerceConfigurationCommand(TestCase):
|
||||
"""
|
||||
Test django management command for enabling commerce configuration.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def test_commerce_configuration(self):
|
||||
"""
|
||||
|
||||
@@ -37,7 +37,6 @@ class TestRefundSignal(TestCase):
|
||||
"""
|
||||
Exercises logic triggered by the REFUND_ORDER signal.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(TestRefundSignal, self).setUp()
|
||||
|
||||
@@ -38,7 +38,6 @@ def update_commerce_config(enabled=False, checkout_page='/test_basket/add/'):
|
||||
|
||||
class AuditLogTests(TestCase):
|
||||
"""Tests of the commerce audit logging helper."""
|
||||
shard = 4
|
||||
|
||||
@patch('openedx.core.lib.log_utils.log')
|
||||
def test_log_message(self, mock_log):
|
||||
@@ -54,7 +53,6 @@ class AuditLogTests(TestCase):
|
||||
@ddt.ddt
|
||||
class EcommerceServiceTests(TestCase):
|
||||
"""Tests for the EcommerceService helper class."""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
self.request_factory = RequestFactory()
|
||||
@@ -185,7 +183,6 @@ class EcommerceServiceTests(TestCase):
|
||||
@skip_unless_lms
|
||||
class RefundUtilMethodTests(ModuleStoreTestCase):
|
||||
"""Tests for Refund Utilities"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(RefundUtilMethodTests, self).setUp()
|
||||
|
||||
@@ -29,7 +29,6 @@ class UserMixin(object):
|
||||
@ddt.ddt
|
||||
class ReceiptViewTests(UserMixin, ModuleStoreTestCase):
|
||||
""" Tests for the receipt view. """
|
||||
shard = 1
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
|
||||
@@ -27,7 +27,6 @@ class TestGetBlocks(SharedModuleStoreTestCase):
|
||||
"""
|
||||
Tests for the get_blocks function
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
@@ -117,7 +116,6 @@ class TestGetBlocksMobileHack(SharedModuleStoreTestCase):
|
||||
"""
|
||||
Tests that requests from the mobile app don't receive empty containers.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
@@ -165,7 +163,6 @@ class TestGetBlocksQueryCountsBase(SharedModuleStoreTestCase):
|
||||
"""
|
||||
Base for the get_blocks tests.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
ENABLED_SIGNALS = ['course_published']
|
||||
|
||||
@@ -198,7 +195,6 @@ class TestGetBlocksQueryCounts(TestGetBlocksQueryCountsBase):
|
||||
"""
|
||||
Tests query counts for the get_blocks function.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
@ddt.data(
|
||||
*product(
|
||||
@@ -247,7 +243,6 @@ class TestQueryCountsWithIndividualOverrideProvider(TestGetBlocksQueryCountsBase
|
||||
"""
|
||||
Tests query counts for the get_blocks function when IndividualStudentOverrideProvider is set.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
@ddt.data(
|
||||
*product(
|
||||
|
||||
@@ -22,7 +22,6 @@ class TestBlockListGetForm(FormTestMixin, SharedModuleStoreTestCase):
|
||||
"""
|
||||
Tests for BlockListGetForm
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
FORM_CLASS = BlockListGetForm
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ class TestBlockSerializerBase(SharedModuleStoreTestCase):
|
||||
"""
|
||||
Base class for testing BlockSerializer and BlockDictSerializer
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
@@ -153,7 +152,6 @@ class TestBlockSerializer(TestBlockSerializerBase):
|
||||
"""
|
||||
Tests the BlockSerializer class, which returns a list of blocks.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def create_serializer(self, context=None):
|
||||
"""
|
||||
@@ -195,7 +193,6 @@ class TestBlockDictSerializer(TestBlockSerializerBase):
|
||||
"""
|
||||
Tests the BlockDictSerializer class, which returns a dict of blocks key-ed by its block_key.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def create_serializer(self, context=None):
|
||||
"""
|
||||
|
||||
@@ -21,7 +21,6 @@ class TestBlocksView(SharedModuleStoreTestCase):
|
||||
"""
|
||||
Test class for BlocksView
|
||||
"""
|
||||
shard = 4
|
||||
requested_fields = ['graded', 'format', 'student_view_multi_device', 'children', 'not_a_field', 'due']
|
||||
BLOCK_TYPES_WITH_STUDENT_VIEW_DATA = ['video', 'discussion', 'html']
|
||||
|
||||
@@ -251,7 +250,6 @@ class TestBlocksInCourseView(TestBlocksView):
|
||||
"""
|
||||
Test class for BlocksInCourseView
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(TestBlocksInCourseView, self).setUp()
|
||||
|
||||
@@ -41,7 +41,6 @@ class BlockCompletionTransformerTestCase(TransformerRegistryTestMixin, Completio
|
||||
"""
|
||||
Tests behaviour of BlockCompletionTransformer
|
||||
"""
|
||||
shard = 4
|
||||
TRANSFORMER_CLASS_TO_TEST = BlockCompletionTransformer
|
||||
COMPLETION_TEST_VALUE = 0.4
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ class TestBlockCountsTransformer(ModuleStoreTestCase):
|
||||
"""
|
||||
Test behavior of BlockCountsTransformer
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(TestBlockCountsTransformer, self).setUp()
|
||||
|
||||
@@ -19,7 +19,6 @@ class BlockDepthTransformerTestCase(TestCase, ChildrenMapTestMixin):
|
||||
"""
|
||||
Test behavior of BlockDepthTransformer
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
@ddt.data(
|
||||
(0, [], [], []),
|
||||
|
||||
@@ -22,7 +22,6 @@ class MilestonesTransformerTestCase(CourseStructureTestCase, MilestonesTestCaseM
|
||||
Test behavior of ProctoredExamTransformer
|
||||
"""
|
||||
TRANSFORMER_CLASS_TO_TEST = MilestonesAndSpecialExamsTransformer
|
||||
shard = 3
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
|
||||
@@ -21,7 +21,6 @@ class BlockNavigationTransformerTestCase(TestCase, ChildrenMapTestMixin):
|
||||
"""
|
||||
Course-agnostic test class for testing the Navigation transformer.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
@ddt.data(
|
||||
(0, 0, [], []),
|
||||
@@ -72,7 +71,6 @@ class BlockNavigationTransformerCourseTestCase(ModuleStoreTestCase):
|
||||
Uses SampleCourseFactory and Modulestore to test the Navigation transformer,
|
||||
specifically to test enforcement of the hide_from_toc field
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def test_hide_from_toc(self):
|
||||
course_key = SampleCourseFactory.create().id
|
||||
|
||||
@@ -16,7 +16,6 @@ class TestStudentViewTransformer(ModuleStoreTestCase):
|
||||
"""
|
||||
Test proper behavior for StudentViewTransformer
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(TestStudentViewTransformer, self).setUp()
|
||||
|
||||
@@ -22,7 +22,6 @@ class CourseApiTestMixin(CourseApiFactoryMixin):
|
||||
"""
|
||||
Establish basic functionality for Course API tests
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
@@ -58,7 +57,6 @@ class TestGetCourseDetail(CourseDetailTestMixin, SharedModuleStoreTestCase):
|
||||
"""
|
||||
Test course_detail api function
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
@@ -94,7 +92,6 @@ class CourseListTestMixin(CourseApiTestMixin):
|
||||
"""
|
||||
Common behavior for list_courses tests
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def _make_api_call(self, requesting_user, specified_user, org=None, filter_=None):
|
||||
"""
|
||||
@@ -118,7 +115,6 @@ class TestGetCourseList(CourseListTestMixin, SharedModuleStoreTestCase):
|
||||
"""
|
||||
Test the behavior of the `list_courses` api function.
|
||||
"""
|
||||
shard = 4
|
||||
ENABLED_SIGNALS = ['course_published']
|
||||
|
||||
@classmethod
|
||||
@@ -161,7 +157,6 @@ class TestGetCourseListMultipleCourses(CourseListTestMixin, ModuleStoreTestCase)
|
||||
Test the behavior of the `list_courses` api function (with tests that
|
||||
modify the courseware).
|
||||
"""
|
||||
shard = 4
|
||||
ENABLED_SIGNALS = ['course_published']
|
||||
|
||||
def setUp(self):
|
||||
@@ -220,7 +215,6 @@ class TestGetCourseListExtras(CourseListTestMixin, ModuleStoreTestCase):
|
||||
Tests of course_list api function that require alternative configurations
|
||||
of created courses.
|
||||
"""
|
||||
shard = 4
|
||||
ENABLED_SIGNALS = ['course_published']
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -21,7 +21,6 @@ class UsernameTestMixin(object):
|
||||
"""
|
||||
Tests the username Form field.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def test_no_user_param_anonymous_access(self):
|
||||
self.set_up_data(AnonymousUser())
|
||||
@@ -39,7 +38,6 @@ class TestCourseListGetForm(FormTestMixin, UsernameTestMixin, SharedModuleStoreT
|
||||
"""
|
||||
Tests for CourseListGetForm
|
||||
"""
|
||||
shard = 4
|
||||
FORM_CLASS = CourseListGetForm
|
||||
|
||||
@classmethod
|
||||
@@ -105,7 +103,6 @@ class TestCourseDetailGetForm(FormTestMixin, UsernameTestMixin, SharedModuleStor
|
||||
"""
|
||||
Tests for CourseDetailGetForm
|
||||
"""
|
||||
shard = 4
|
||||
FORM_CLASS = CourseDetailGetForm
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -16,7 +16,6 @@ class ViewCoursesForUsernameTestCase(CourseApiFactoryMixin, TestCase):
|
||||
Any user should be able to view their own courses, and staff users
|
||||
should be able to view anyone's courses.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
||||
@@ -29,7 +29,6 @@ class TestCourseSerializer(CourseApiFactoryMixin, ModuleStoreTestCase):
|
||||
expected_mongo_calls = 0
|
||||
maxDiff = 5000 # long enough to show mismatched dicts, in case of error
|
||||
serializer_class = CourseSerializer
|
||||
shard = 3
|
||||
|
||||
ENABLED_SIGNALS = ['course_published']
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ from search.tests.utils import SearcherMixin
|
||||
from course_modes.models import CourseMode
|
||||
from course_modes.tests.factories import CourseModeFactory
|
||||
from edx_django_utils.cache import RequestCache
|
||||
from openedx.core.lib.tests import attr
|
||||
from openedx.features.content_type_gating.models import ContentTypeGatingConfig
|
||||
from openedx.features.course_duration_limits.models import CourseDurationLimitConfig
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, SharedModuleStoreTestCase
|
||||
@@ -62,7 +61,6 @@ class CourseApiTestViewMixin(CourseApiFactoryMixin):
|
||||
return response
|
||||
|
||||
|
||||
@attr(shard=9)
|
||||
@ddt.ddt
|
||||
class CourseListViewTestCase(CourseApiTestViewMixin, SharedModuleStoreTestCase):
|
||||
"""
|
||||
@@ -144,7 +142,6 @@ class CourseListViewTestCase(CourseApiTestViewMixin, SharedModuleStoreTestCase):
|
||||
self.assert_throttle_configured_correctly(user_scope, throws_exception, expected_rate)
|
||||
|
||||
|
||||
@attr(shard=9)
|
||||
class CourseListViewTestCaseMultipleCourses(CourseApiTestViewMixin, ModuleStoreTestCase):
|
||||
"""
|
||||
Test responses returned from CourseListView (with tests that modify the
|
||||
@@ -206,7 +203,6 @@ class CourseListViewTestCaseMultipleCourses(CourseApiTestViewMixin, ModuleStoreT
|
||||
)
|
||||
|
||||
|
||||
@attr(shard=9)
|
||||
class CourseDetailViewTestCase(CourseApiTestViewMixin, SharedModuleStoreTestCase):
|
||||
"""
|
||||
Test responses returned from CourseDetailView.
|
||||
@@ -274,7 +270,6 @@ class CourseDetailViewTestCase(CourseApiTestViewMixin, SharedModuleStoreTestCase
|
||||
self.assertEquals(response.status_code, 400)
|
||||
|
||||
|
||||
@attr(shard=9)
|
||||
@override_settings(ELASTIC_FIELD_MAPPINGS={
|
||||
'start_date': {'type': 'date'},
|
||||
'enrollment_start': {'type': 'date'},
|
||||
|
||||
@@ -17,7 +17,6 @@ class HiddenContentTransformerTestCase(BlockParentsMapTestCase):
|
||||
"""
|
||||
TRANSFORMER_CLASS_TO_TEST = HiddenContentTransformer
|
||||
ALL_BLOCKS = {0, 1, 2, 3, 4, 5, 6}
|
||||
shard = 3
|
||||
|
||||
class DueDateType(object):
|
||||
"""
|
||||
|
||||
@@ -26,7 +26,6 @@ class ContentLibraryTransformerTestCase(CourseStructureTestCase):
|
||||
"""
|
||||
ContentLibraryTransformer Test
|
||||
"""
|
||||
shard = 4
|
||||
TRANSFORMER_CLASS_TO_TEST = ContentLibraryTransformer
|
||||
|
||||
def setUp(self):
|
||||
|
||||
@@ -30,7 +30,6 @@ class TestOverrideDataTransformer(ModuleStoreTestCase):
|
||||
"""
|
||||
Test proper behavior for OverrideDataTransformer
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
||||
@@ -22,7 +22,6 @@ class SplitTestTransformerTestCase(CourseStructureTestCase):
|
||||
"""
|
||||
TEST_PARTITION_ID = 0
|
||||
TRANSFORMER_CLASS_TO_TEST = UserPartitionTransformer
|
||||
shard = 3
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
|
||||
@@ -21,7 +21,6 @@ class StartDateTransformerTestCase(BlockParentsMapTestCase):
|
||||
STUDENT = 1
|
||||
BETA_USER = 2
|
||||
TRANSFORMER_CLASS_TO_TEST = StartDateTransformer
|
||||
shard = 3
|
||||
|
||||
class StartDateType(object):
|
||||
"""
|
||||
|
||||
@@ -73,7 +73,6 @@ class UserPartitionTransformerTestCase(UserPartitionTestMixin, CourseStructureTe
|
||||
"""
|
||||
UserPartitionTransformer Test
|
||||
"""
|
||||
shard = 3
|
||||
|
||||
def setup_partitions_and_course(self, active=True):
|
||||
"""
|
||||
@@ -247,7 +246,6 @@ class MergedGroupAccessTestData(UserPartitionTestMixin, CourseStructureTestCase)
|
||||
"""
|
||||
_MergedGroupAccess Test
|
||||
"""
|
||||
shard = 3
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
|
||||
@@ -13,7 +13,6 @@ class VisibilityTransformerTestCase(BlockParentsMapTestCase):
|
||||
VisibilityTransformer Test
|
||||
"""
|
||||
TRANSFORMER_CLASS_TO_TEST = VisibilityTransformer
|
||||
shard = 3
|
||||
|
||||
# Following test cases are based on BlockParentsMapTestCase.parents_map
|
||||
@ddt.data(
|
||||
|
||||
@@ -22,7 +22,6 @@ class TestCourseGoalsAPI(EventTrackingTestCase, SharedModuleStoreTestCase):
|
||||
"""
|
||||
Testing the Course Goals API.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
# Create a course with a verified track
|
||||
|
||||
@@ -9,7 +9,6 @@ from course_wiki import settings
|
||||
from course_wiki.utils import course_wiki_slug, user_is_article_course_staff
|
||||
from course_wiki.views import get_or_create_root
|
||||
from courseware.tests.factories import InstructorFactory, StaffFactory
|
||||
from openedx.core.lib.tests import attr
|
||||
from student.tests.factories import UserFactory
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
@@ -51,7 +50,6 @@ class TestWikiAccessBase(ModuleStoreTestCase):
|
||||
]
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class TestWikiAccess(TestWikiAccessBase):
|
||||
"""Test wiki access for course staff."""
|
||||
def setUp(self):
|
||||
@@ -112,7 +110,6 @@ class TestWikiAccess(TestWikiAccessBase):
|
||||
self.assertFalse(user_is_article_course_staff(course_staff, self.wiki_310b.article))
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class TestWikiAccessForStudent(TestWikiAccessBase):
|
||||
"""Test access for students."""
|
||||
def setUp(self):
|
||||
@@ -128,7 +125,6 @@ class TestWikiAccessForStudent(TestWikiAccessBase):
|
||||
self.assertFalse(user_is_article_course_staff(self.student, page.article))
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class TestWikiAccessForNumericalCourseNumber(TestWikiAccessBase):
|
||||
"""Test staff has access if course number is numerical and wiki slug has an underscore appended."""
|
||||
def setUp(self):
|
||||
@@ -148,7 +144,6 @@ class TestWikiAccessForNumericalCourseNumber(TestWikiAccessBase):
|
||||
self.assertTrue(user_is_article_course_staff(course_staff, page.article))
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class TestWikiAccessForOldFormatCourseStaffGroups(TestWikiAccessBase):
|
||||
"""Test staff has access if course group has old format."""
|
||||
def setUp(self):
|
||||
|
||||
@@ -15,7 +15,6 @@ from xmodule.modulestore.tests.factories import CourseFactory
|
||||
|
||||
class TestComprehensiveTheming(ModuleStoreTestCase):
|
||||
"""Tests for comprehensive theming of wiki pages."""
|
||||
shard = 1
|
||||
|
||||
def setUp(self):
|
||||
"""Test setup."""
|
||||
|
||||
@@ -13,7 +13,6 @@ from xmodule.modulestore.tests.factories import CourseFactory
|
||||
|
||||
class TestWikiAccessMiddleware(ModuleStoreTestCase):
|
||||
"""Tests for WikiAccessMiddleware."""
|
||||
shard = 1
|
||||
|
||||
def setUp(self):
|
||||
"""Test setup."""
|
||||
|
||||
@@ -13,7 +13,6 @@ from xmodule.modulestore.tests.factories import CourseFactory
|
||||
|
||||
class WikiTabTestCase(ModuleStoreTestCase):
|
||||
"""Test cases for Wiki Tab."""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(WikiTabTestCase, self).setUp()
|
||||
|
||||
@@ -16,7 +16,6 @@ class WikiRedirectTestCase(EnterpriseTestConsentRequired, LoginEnrollmentTestCas
|
||||
"""
|
||||
Tests for wiki course redirection.
|
||||
"""
|
||||
shard = 1
|
||||
|
||||
def setUp(self):
|
||||
super(WikiRedirectTestCase, self).setUp()
|
||||
|
||||
@@ -37,7 +37,6 @@ class CommandsTestBase(SharedModuleStoreTestCase):
|
||||
__test__ = False
|
||||
url_name = '2012_Fall'
|
||||
ENABLED_SIGNALS = ['course_published']
|
||||
shard = 1
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
||||
@@ -16,7 +16,6 @@ from waffle.testutils import override_switch
|
||||
|
||||
from course_modes.models import CourseMode
|
||||
from lms.djangoapps.ccx.tests.factories import CcxFactory
|
||||
from openedx.core.lib.tests import attr
|
||||
from openedx.core.djangoapps.waffle_utils.testutils import override_waffle_flag
|
||||
from openedx.features.course_experience.waffle import WAFFLE_NAMESPACE as COURSE_EXPERIENCE_WAFFLE_NAMESPACE
|
||||
from openedx.features.course_experience.waffle import ENABLE_COURSE_ABOUT_SIDEBAR_HTML
|
||||
@@ -51,7 +50,6 @@ SHIB_ERROR_STR = "The currently logged-in user account does not have permission
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
@attr(shard=1)
|
||||
class AboutTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase, EventTrackingTestCase, MilestonesTestCaseMixin):
|
||||
"""
|
||||
Tests about xblock.
|
||||
@@ -254,7 +252,6 @@ class AboutTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase, EventTra
|
||||
self.assertIn("Enroll in", resp.content)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class AboutTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
"""
|
||||
Tests for the course about page
|
||||
@@ -302,7 +299,6 @@ class AboutTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
self.assertIn(self.xml_data, resp.content)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class AboutWithCappedEnrollmentsTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase):
|
||||
"""
|
||||
This test case will check the About page when a course has a capped enrollment
|
||||
@@ -349,7 +345,6 @@ class AboutWithCappedEnrollmentsTestCase(LoginEnrollmentTestCase, SharedModuleSt
|
||||
self.assertNotIn(REG_STR, resp.content)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class AboutWithInvitationOnly(SharedModuleStoreTestCase):
|
||||
"""
|
||||
This test case will check the About page when a course is invitation only.
|
||||
@@ -395,7 +390,6 @@ class AboutWithInvitationOnly(SharedModuleStoreTestCase):
|
||||
self.assertIn(REG_STR, resp.content)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@patch.dict(settings.FEATURES, {'RESTRICT_ENROLL_BY_REG_METHOD': True})
|
||||
class AboutTestCaseShibCourse(LoginEnrollmentTestCase, SharedModuleStoreTestCase):
|
||||
"""
|
||||
@@ -436,7 +430,6 @@ class AboutTestCaseShibCourse(LoginEnrollmentTestCase, SharedModuleStoreTestCase
|
||||
self.assertIn(REG_STR, resp.content)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class AboutWithClosedEnrollment(ModuleStoreTestCase):
|
||||
"""
|
||||
This test case will check the About page for a course that has enrollment start/end
|
||||
@@ -479,7 +472,6 @@ class AboutWithClosedEnrollment(ModuleStoreTestCase):
|
||||
self.assertNotIn('<span class="important-dates-item-text">$10</span>', resp.content)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@ddt.ddt
|
||||
class AboutSidebarHTMLTestCase(SharedModuleStoreTestCase):
|
||||
"""
|
||||
@@ -523,7 +515,6 @@ class AboutSidebarHTMLTestCase(SharedModuleStoreTestCase):
|
||||
self.assertNotIn('<section class="about-sidebar-html">', resp.content)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@patch.dict(settings.FEATURES, {'ENABLE_SHOPPING_CART': True})
|
||||
@patch.dict(settings.FEATURES, {'ENABLE_PAID_COURSE_REGISTRATION': True})
|
||||
class AboutPurchaseCourseTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase):
|
||||
|
||||
@@ -30,7 +30,6 @@ from courseware.tests.helpers import LoginEnrollmentTestCase, masquerade_as_grou
|
||||
from lms.djangoapps.ccx.models import CustomCourseForEdX
|
||||
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
|
||||
from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES
|
||||
from openedx.core.lib.tests import attr
|
||||
from openedx.features.content_type_gating.models import ContentTypeGatingConfig
|
||||
from student.models import CourseEnrollment
|
||||
from student.roles import CourseCcxCoachRole, CourseStaffRole
|
||||
@@ -157,7 +156,6 @@ class CoachAccessTestCaseCCX(SharedModuleStoreTestCase, LoginEnrollmentTestCase)
|
||||
self.assertEqual(resp.status_code, 404)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@ddt.ddt
|
||||
class AccessTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase, MilestonesTestCaseMixin):
|
||||
"""
|
||||
@@ -673,7 +671,6 @@ class AccessTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase, MilestonesTes
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class UserRoleTestCase(TestCase):
|
||||
"""
|
||||
Tests for user roles.
|
||||
@@ -730,7 +727,6 @@ class UserRoleTestCase(TestCase):
|
||||
)
|
||||
|
||||
|
||||
@attr(shard=5)
|
||||
@ddt.ddt
|
||||
class CourseOverviewAccessTestCase(ModuleStoreTestCase):
|
||||
"""
|
||||
|
||||
@@ -12,7 +12,6 @@ from openedx.core.lib.tempdir import create_symlink, delete_symlink, mkdtemp_cle
|
||||
|
||||
class TestComprehensiveTheming(TestCase):
|
||||
"""Test comprehensive theming."""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(TestComprehensiveTheming, self).setUp()
|
||||
|
||||
@@ -14,7 +14,6 @@ class UserPrefContextProcessorUnitTest(ModuleStoreTestCase):
|
||||
"""
|
||||
Unit test for courseware context_processor
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
super(UserPrefContextProcessorUnitTest, self).setUp()
|
||||
|
||||
@@ -15,7 +15,6 @@ from lms.djangoapps.ccx.tests.factories import CcxFactory
|
||||
from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration
|
||||
from openedx.core.djangoapps.site_configuration.tests.test_util import with_site_configuration_context
|
||||
from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES, override_waffle_flag
|
||||
from openedx.core.lib.tests import attr
|
||||
from openedx.features.content_type_gating.models import ContentTypeGatingConfig
|
||||
from openedx.features.course_experience import UNIFIED_COURSE_TAB_FLAG
|
||||
from openedx.features.enterprise_support.tests.mixins.enterprise import EnterpriseTestConsentRequired
|
||||
@@ -39,7 +38,6 @@ from .helpers import LoginEnrollmentTestCase
|
||||
QUERY_COUNT_TABLE_BLACKLIST = WAFFLE_TABLES
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=False)
|
||||
class CourseInfoTestCase(EnterpriseTestConsentRequired, LoginEnrollmentTestCase, SharedModuleStoreTestCase):
|
||||
"""
|
||||
@@ -153,7 +151,6 @@ class CourseInfoTestCase(EnterpriseTestConsentRequired, LoginEnrollmentTestCase,
|
||||
self.assertEqual(response.status_code, 404)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=False)
|
||||
class CourseInfoLastAccessedTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
"""
|
||||
@@ -222,7 +219,6 @@ class CourseInfoLastAccessedTestCase(LoginEnrollmentTestCase, ModuleStoreTestCas
|
||||
self.assertEqual(resume_course_url, section_url)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=False)
|
||||
@ddt.ddt
|
||||
class CourseInfoTitleTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
@@ -352,7 +348,6 @@ class CourseInfoTestCaseCCX(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
|
||||
self.assertRedirects(response, expected, status_code=302, target_status_code=200)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=False)
|
||||
class CourseInfoTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
"""
|
||||
@@ -401,7 +396,6 @@ class CourseInfoTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
self.assertNotIn(self.xml_data, resp.content)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@override_settings(FEATURES=dict(settings.FEATURES, EMBARGO=False))
|
||||
@override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=False)
|
||||
class SelfPacedCourseInfoTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase):
|
||||
|
||||
@@ -19,7 +19,6 @@ class SurveyViewsTests(LoginEnrollmentTestCase, SharedModuleStoreTestCase, XssTe
|
||||
"""
|
||||
All tests for the views.py file
|
||||
"""
|
||||
shard = 1
|
||||
STUDENT_INFO = [('view@test.com', 'foo')]
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -23,7 +23,6 @@ from xmodule.modulestore.tests.factories import CourseFactory
|
||||
|
||||
|
||||
class VerifiedUpgradeToolTest(SharedModuleStoreTestCase):
|
||||
shard = 3
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
||||
@@ -34,7 +34,6 @@ from courseware.module_render import get_module_for_descriptor
|
||||
from lms.djangoapps.courseware.courseware_access_exception import CoursewareAccessException
|
||||
from openedx.core.djangolib.testing.utils import get_mock_request
|
||||
from openedx.core.lib.courses import course_image_url
|
||||
from openedx.core.lib.tests import attr
|
||||
from student.tests.factories import UserFactory
|
||||
from xmodule.modulestore import ModuleStoreEnum
|
||||
from xmodule.modulestore.django import _get_modulestore_branch_setting, modulestore
|
||||
@@ -48,7 +47,6 @@ CMS_BASE_TEST = 'testcms'
|
||||
TEST_DATA_DIR = settings.COMMON_TEST_DATA_ROOT
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@ddt.ddt
|
||||
class CoursesTest(ModuleStoreTestCase):
|
||||
"""Test methods related to fetching courses."""
|
||||
@@ -192,7 +190,6 @@ class CoursesTest(ModuleStoreTestCase):
|
||||
self.assertIsNone(get_current_child(mock_xmodule))
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class ModuleStoreBranchSettingTest(ModuleStoreTestCase):
|
||||
"""Test methods related to the modulestore branch setting."""
|
||||
@mock.patch(
|
||||
@@ -218,7 +215,6 @@ class ModuleStoreBranchSettingTest(ModuleStoreTestCase):
|
||||
self.assertEqual(_get_modulestore_branch_setting(), 'fake_default_branch')
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@override_settings(CMS_BASE=CMS_BASE_TEST)
|
||||
class MongoCourseImageTestCase(ModuleStoreTestCase):
|
||||
"""Tests for course image URLs when using a mongo modulestore."""
|
||||
@@ -274,7 +270,6 @@ class MongoCourseImageTestCase(ModuleStoreTestCase):
|
||||
)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class XmlCourseImageTestCase(XModuleXmlImportTest):
|
||||
"""Tests for course image URLs when using an xml modulestore."""
|
||||
|
||||
@@ -292,7 +287,6 @@ class XmlCourseImageTestCase(XModuleXmlImportTest):
|
||||
self.assertEquals(course_image_url(course), u'/static/xml_test_course/before after.jpg')
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class CoursesRenderTest(ModuleStoreTestCase):
|
||||
"""Test methods related to rendering courses content."""
|
||||
|
||||
@@ -385,7 +379,6 @@ class CourseEnrollmentOpenTests(ModuleStoreTestCase):
|
||||
self.assertFalse(course_open_for_self_enrollment(course.id))
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@ddt.ddt
|
||||
class CourseInstantiationTests(ModuleStoreTestCase):
|
||||
"""
|
||||
@@ -430,7 +423,6 @@ class CourseInstantiationTests(ModuleStoreTestCase):
|
||||
self.assertTrue(item.graded)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class TestGetCourseChapters(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests for the `get_course_chapter_ids` function.
|
||||
|
||||
@@ -21,7 +21,6 @@ class ProgressPageCreditRequirementsTest(SharedModuleStoreTestCase):
|
||||
"""
|
||||
Tests for credit requirement display on the progress page.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
USERNAME = "bob"
|
||||
PASSWORD = "test"
|
||||
|
||||
@@ -36,14 +36,12 @@ from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration
|
||||
from openedx.core.djangoapps.site_configuration.tests.factories import SiteFactory
|
||||
from openedx.core.djangoapps.user_api.preferences.api import set_user_preference
|
||||
from openedx.core.djangoapps.waffle_utils.testutils import override_waffle_flag
|
||||
from openedx.core.lib.tests import attr
|
||||
from openedx.features.course_experience import UNIFIED_COURSE_TAB_FLAG, UPGRADE_DEADLINE_MESSAGE, CourseHomeMessages
|
||||
from student.tests.factories import TEST_PASSWORD, CourseEnrollmentFactory, UserFactory
|
||||
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@ddt.ddt
|
||||
class CourseDateSummaryTest(SharedModuleStoreTestCase):
|
||||
"""Tests for course date summary blocks."""
|
||||
@@ -450,7 +448,6 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase):
|
||||
self.assertEqual(block.relative_datestring, expected_date_string)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@ddt.ddt
|
||||
class TestDateAlerts(SharedModuleStoreTestCase):
|
||||
"""
|
||||
@@ -567,7 +564,6 @@ class TestDateAlerts(SharedModuleStoreTestCase):
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
@attr(shard=1)
|
||||
class TestScheduleOverrides(SharedModuleStoreTestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
||||
@@ -31,7 +31,6 @@ class TestDiscussionXBlock(XModuleRenderingTestBase):
|
||||
Base class for tests
|
||||
"""
|
||||
|
||||
shard = 4
|
||||
PATCH_DJANGO_USER = True
|
||||
|
||||
def setUp(self):
|
||||
@@ -85,7 +84,6 @@ class TestGetDjangoUser(TestDiscussionXBlock):
|
||||
Tests for the django_user property.
|
||||
"""
|
||||
|
||||
shard = 4
|
||||
PATCH_DJANGO_USER = False
|
||||
|
||||
def setUp(self):
|
||||
@@ -123,7 +121,6 @@ class TestViews(TestDiscussionXBlock):
|
||||
"""
|
||||
Tests for student_view and author_view.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
@@ -210,7 +207,6 @@ class TestTemplates(TestDiscussionXBlock):
|
||||
"""
|
||||
Tests rendering of templates.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def test_has_permission(self):
|
||||
"""
|
||||
@@ -256,7 +252,6 @@ class TestXBlockInCourse(SharedModuleStoreTestCase):
|
||||
"""
|
||||
Test the discussion xblock as rendered in the course and course API.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
@@ -380,7 +375,6 @@ class TestXBlockQueryLoad(SharedModuleStoreTestCase):
|
||||
"""
|
||||
Test the number of queries executed when rendering the XBlock.
|
||||
"""
|
||||
shard = 4
|
||||
|
||||
def test_permissions_query_load(self):
|
||||
"""
|
||||
|
||||
@@ -8,7 +8,6 @@ class TestDraftModuleStore(TestCase):
|
||||
"""
|
||||
Test the draft modulestore
|
||||
"""
|
||||
shard = 1
|
||||
|
||||
def test_get_items_with_course_items(self):
|
||||
store = modulestore()
|
||||
|
||||
@@ -43,7 +43,6 @@ class EntranceExamTestCases(LoginEnrollmentTestCase, ModuleStoreTestCase, Milest
|
||||
Creates a test course from scratch. The tests below are designed to execute
|
||||
workflows regardless of the feature flag settings.
|
||||
"""
|
||||
shard = 2
|
||||
|
||||
@patch.dict('django.conf.settings.FEATURES', {'ENTRANCE_EXAMS': True})
|
||||
def setUp(self):
|
||||
|
||||
@@ -8,7 +8,6 @@ class FaviconTestCase(UrlResetMixin, TestCase):
|
||||
"""
|
||||
Tests of the courseware favicon.
|
||||
"""
|
||||
shard = 1
|
||||
|
||||
def test_favicon_redirect(self):
|
||||
resp = self.client.get("/favicon.ico")
|
||||
|
||||
@@ -7,7 +7,6 @@ import unittest
|
||||
from django.test.utils import override_settings
|
||||
from xblock.field_data import DictFieldData
|
||||
|
||||
from openedx.core.lib.tests import attr
|
||||
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
|
||||
@@ -60,7 +59,6 @@ class OverrideFieldBase(SharedModuleStoreTestCase):
|
||||
cls.course = CourseFactory.create(enable_ccx=True)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@override_settings(FIELD_OVERRIDE_PROVIDERS=(
|
||||
'courseware.tests.test_field_overrides.TestOverrideProvider',))
|
||||
class OverrideFieldDataTests(OverrideFieldBase):
|
||||
@@ -132,7 +130,6 @@ class OverrideFieldDataTests(OverrideFieldBase):
|
||||
self.assertIsInstance(data, DictFieldData)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
@override_settings(
|
||||
MODULESTORE_FIELD_OVERRIDE_PROVIDERS=['courseware.tests.test_field_overrides.TestOverrideProvider']
|
||||
)
|
||||
@@ -149,7 +146,6 @@ class OverrideModulestoreFieldDataTests(FieldOverrideTestMixin, OverrideFieldDat
|
||||
self.assertIsInstance(data, DictFieldData)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class ResolveDottedTests(unittest.TestCase):
|
||||
"""
|
||||
Tests for `resolve_dotted`.
|
||||
|
||||
@@ -17,7 +17,6 @@ class TestFooter(TestCase):
|
||||
"""
|
||||
Tests for edx and OpenEdX footer
|
||||
"""
|
||||
shard = 1
|
||||
|
||||
SOCIAL_MEDIA_NAMES = [
|
||||
"facebook",
|
||||
|
||||
@@ -55,7 +55,6 @@ class GroupAccessTestCase(ModuleStoreTestCase):
|
||||
Tests to ensure that has_access() correctly enforces the visibility
|
||||
restrictions specified in the `group_access` field of XBlocks.
|
||||
"""
|
||||
shard = 7
|
||||
|
||||
def set_user_group(self, user, partition, group):
|
||||
"""
|
||||
|
||||
@@ -14,7 +14,6 @@ from django.utils import translation
|
||||
from openedx.core.djangoapps.dark_lang.models import DarkLangConfig
|
||||
from openedx.core.djangoapps.lang_pref import LANGUAGE_KEY
|
||||
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
|
||||
from openedx.core.lib.tests import attr
|
||||
from student.tests.factories import UserFactory
|
||||
|
||||
|
||||
@@ -70,7 +69,6 @@ class BaseI18nTestCase(CacheIsolationTestCase):
|
||||
self.client.login(username=self.user.username, password=self.pwd)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class I18nTestCase(BaseI18nTestCase):
|
||||
"""
|
||||
Tests for i18n
|
||||
@@ -104,7 +102,6 @@ class I18nTestCase(BaseI18nTestCase):
|
||||
self.assert_tag_has_attr(response.content, "body", "class", "rtl")
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class I18nRegressionTests(BaseI18nTestCase):
|
||||
"""
|
||||
Tests for i18n
|
||||
@@ -159,7 +156,6 @@ class I18nRegressionTests(BaseI18nTestCase):
|
||||
self.assert_tag_has_attr(response.content, "html", "lang", site_lang)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class I18nLangPrefTests(BaseI18nTestCase):
|
||||
"""
|
||||
Regression tests of language presented to the user, when they
|
||||
|
||||
@@ -27,7 +27,6 @@ class TestLTI(BaseTestXmodule):
|
||||
of `oauthlib` library.
|
||||
"""
|
||||
CATEGORY = "lti"
|
||||
shard = 1
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
@@ -131,7 +130,6 @@ class TestLTIModuleListing(SharedModuleStoreTestCase):
|
||||
# arbitrary constant
|
||||
COURSE_SLUG = "100"
|
||||
COURSE_NAME = "test_course"
|
||||
shard = 1
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
||||
@@ -22,7 +22,6 @@ from openedx.core.djangoapps.lang_pref import LANGUAGE_KEY
|
||||
from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration
|
||||
from openedx.core.djangoapps.user_api.preferences.api import get_user_preference, set_user_preference
|
||||
from openedx.core.djangoapps.waffle_utils.testutils import override_waffle_flag
|
||||
from openedx.core.lib.tests import attr
|
||||
from openedx.features.course_experience import UNIFIED_COURSE_TAB_FLAG
|
||||
from student.models import CourseEnrollment
|
||||
from student.tests.factories import UserFactory
|
||||
@@ -166,7 +165,6 @@ class MasqueradeTestCase(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
|
||||
self.assertEqual(200, masquerade_as_group_member(self.test_user, self.course, partition_id, group_id))
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class NormalStudentVisibilityTest(MasqueradeTestCase):
|
||||
"""
|
||||
Verify the course displays as expected for a "normal" student (to ensure test setup is correct).
|
||||
@@ -221,7 +219,6 @@ class StaffMasqueradeTestCase(MasqueradeTestCase):
|
||||
return response
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class TestStaffMasqueradeAsStudent(StaffMasqueradeTestCase):
|
||||
"""
|
||||
Check for staff being able to masquerade as student.
|
||||
@@ -260,7 +257,6 @@ class TestStaffMasqueradeAsStudent(StaffMasqueradeTestCase):
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
@attr(shard=1)
|
||||
class TestStaffMasqueradeAsSpecificStudent(StaffMasqueradeTestCase, ProblemSubmissionTestMixin):
|
||||
"""
|
||||
Check for staff being able to masquerade as a specific student.
|
||||
@@ -455,7 +451,6 @@ class TestStaffMasqueradeAsSpecificStudent(StaffMasqueradeTestCase, ProblemSubmi
|
||||
self.assertIn("2 of 2 possible points", masquerade_progress)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class TestGetMasqueradingGroupId(StaffMasqueradeTestCase):
|
||||
"""
|
||||
Check for staff being able to masquerade as belonging to a group.
|
||||
|
||||
@@ -21,7 +21,6 @@ class TestSites(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
|
||||
"""
|
||||
This is testing of the Site Configuration feature
|
||||
"""
|
||||
shard = 1
|
||||
STUDENT_INFO = [('view@test.com', 'foo'), ('view2@test.com', 'foo')]
|
||||
ENABLED_SIGNALS = ['course_published']
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ from xmodule.modulestore.tests.factories import CourseFactory
|
||||
|
||||
class CoursewareMiddlewareTestCase(SharedModuleStoreTestCase):
|
||||
"""Tests that courseware middleware is correctly redirected"""
|
||||
shard = 1
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
||||
@@ -26,7 +26,6 @@ from courseware.tests.factories import (
|
||||
course_id,
|
||||
location
|
||||
)
|
||||
from openedx.core.lib.tests import attr
|
||||
from student.tests.factories import UserFactory
|
||||
|
||||
|
||||
@@ -60,7 +59,6 @@ class StudentModuleFactory(cmfStudentModuleFactory):
|
||||
course_id = course_id
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class TestInvalidScopes(TestCase):
|
||||
def setUp(self):
|
||||
super(TestInvalidScopes, self).setUp()
|
||||
@@ -81,7 +79,6 @@ class TestInvalidScopes(TestCase):
|
||||
self.assertRaises(InvalidScopeError, self.kvs.set_many, {key: 'value'})
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class OtherUserFailureTestMixin(object):
|
||||
"""
|
||||
Mixin class to add test cases for failures when a user trying to use the kvs is not
|
||||
@@ -106,7 +103,6 @@ class OtherUserFailureTestMixin(object):
|
||||
self.kvs.set(self.other_key_factory(self.existing_field_name), "new_value")
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class TestStudentModuleStorage(OtherUserFailureTestMixin, TestCase):
|
||||
"""Tests for user_state storage via StudentModule"""
|
||||
other_key_factory = partial(DjangoKeyValueStore.Key, Scope.user_state, 2, location('usage_id')) # user_id=2, not 1
|
||||
@@ -235,7 +231,6 @@ class TestStudentModuleStorage(OtherUserFailureTestMixin, TestCase):
|
||||
self.assertEquals(exception_context.exception.saved_field_names, [])
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class TestMissingStudentModule(TestCase):
|
||||
# Tell Django to clean out all databases, not just default
|
||||
multi_db = True
|
||||
@@ -291,11 +286,9 @@ class TestMissingStudentModule(TestCase):
|
||||
self.assertFalse(self.kvs.has(user_state_key('a_field')))
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class StorageTestBase(object):
|
||||
"""
|
||||
A base class for that gets subclassed when testing each of the scopes.
|
||||
|
||||
"""
|
||||
# Disable pylint warnings that arise because of the way the child classes call
|
||||
# this base class -- pylint's static analysis can't keep up with it.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user