diff --git a/lms/djangoapps/branding/tests/test_models.py b/lms/djangoapps/branding/tests/test_models.py index 7d0876bdb0..d03f155921 100644 --- a/lms/djangoapps/branding/tests/test_models.py +++ b/lms/djangoapps/branding/tests/test_models.py @@ -3,9 +3,12 @@ Tests for the Video Branding configuration. """ from django.test import TestCase from django.core.exceptions import ValidationError +from nose.plugins.attrib import attr + from branding.models import BrandingInfoConfig +@attr('shard_1') class BrandingInfoConfigTest(TestCase): """ Test the BrandingInfoConfig model. diff --git a/lms/djangoapps/branding/tests/test_page.py b/lms/djangoapps/branding/tests/test_page.py index dabcc6f8e0..253733a37c 100644 --- a/lms/djangoapps/branding/tests/test_page.py +++ b/lms/djangoapps/branding/tests/test_page.py @@ -12,6 +12,7 @@ from django.test.client import RequestFactory from pytz import UTC from mock import patch, Mock +from nose.plugins.attrib import attr from edxmako.shortcuts import render_to_response from branding.views import index @@ -43,6 +44,7 @@ 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 @@ -116,6 +118,7 @@ class AnonymousIndexPageTest(ModuleStoreTestCase): self.assertEqual(response._headers.get("location")[1], "/login") # pylint: disable=protected-access +@attr('shard_1') class PreRequisiteCourseCatalog(ModuleStoreTestCase, LoginEnrollmentTestCase): """ Test to simulate and verify fix for disappearing courses in @@ -163,6 +166,7 @@ class PreRequisiteCourseCatalog(ModuleStoreTestCase, LoginEnrollmentTestCase): self.assertIn('course that has pre requisite', resp.content) +@attr('shard_1') class IndexPageCourseCardsSortingTests(ModuleStoreTestCase): """ Test for Index page course cards sorting diff --git a/lms/djangoapps/bulk_email/tests/test_course_optout.py b/lms/djangoapps/bulk_email/tests/test_course_optout.py index 05f478aa84..e72edd222d 100644 --- a/lms/djangoapps/bulk_email/tests/test_course_optout.py +++ b/lms/djangoapps/bulk_email/tests/test_course_optout.py @@ -4,6 +4,7 @@ Unit tests for student optouts from course email """ import json from mock import patch, Mock +from nose.plugins.attrib import attr from django.core import mail from django.core.management import call_command @@ -16,6 +17,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory +@attr('shard_1') @patch('bulk_email.models.html_to_text', Mock(return_value='Mocking CourseEmail.text_message')) class TestOptoutCourseEmails(ModuleStoreTestCase): """ diff --git a/lms/djangoapps/bulk_email/tests/test_email.py b/lms/djangoapps/bulk_email/tests/test_email.py index 874712523c..3732d72d48 100644 --- a/lms/djangoapps/bulk_email/tests/test_email.py +++ b/lms/djangoapps/bulk_email/tests/test_email.py @@ -4,6 +4,7 @@ Unit tests for sending course email """ import json from mock import patch, Mock +from nose.plugins.attrib import attr import os from unittest import skipIf @@ -85,6 +86,7 @@ class EmailSendFromDashboardTestCase(ModuleStoreTestCase): } +@attr('shard_1') @patch.dict(settings.FEATURES, {'ENABLE_INSTRUCTOR_EMAIL': True, 'REQUIRE_COURSE_EMAIL_AUTH': False}) @patch('bulk_email.models.html_to_text', Mock(return_value='Mocking CourseEmail.text_message')) class TestEmailSendFromDashboardMockedHtmlToText(EmailSendFromDashboardTestCase): @@ -313,6 +315,7 @@ class TestEmailSendFromDashboardMockedHtmlToText(EmailSendFromDashboardTestCase) self.assertItemsEqual(outbox_contents, should_send_contents) +@attr('shard_1') @patch.dict(settings.FEATURES, {'ENABLE_INSTRUCTOR_EMAIL': True, 'REQUIRE_COURSE_EMAIL_AUTH': False}) @skipIf(os.environ.get("TRAVIS") == 'true', "Skip this test in Travis CI.") class TestEmailSendFromDashboard(EmailSendFromDashboardTestCase): diff --git a/lms/djangoapps/bulk_email/tests/test_err_handling.py b/lms/djangoapps/bulk_email/tests/test_err_handling.py index 818eeb5fca..9b8db791d9 100644 --- a/lms/djangoapps/bulk_email/tests/test_err_handling.py +++ b/lms/djangoapps/bulk_email/tests/test_err_handling.py @@ -11,6 +11,7 @@ from django.core.urlresolvers import reverse from django.db import DatabaseError import json from mock import patch, Mock +from nose.plugins.attrib import attr from smtplib import SMTPDataError, SMTPServerDisconnected, SMTPConnectError from bulk_email.models import CourseEmail, SEND_TO_ALL @@ -35,6 +36,7 @@ class EmailTestException(Exception): pass +@attr('shard_1') @patch('bulk_email.models.html_to_text', Mock(return_value='Mocking CourseEmail.text_message')) @patch.dict(settings.FEATURES, {'ENABLE_INSTRUCTOR_EMAIL': True, 'REQUIRE_COURSE_EMAIL_AUTH': False}) class TestEmailErrors(ModuleStoreTestCase): diff --git a/lms/djangoapps/bulk_email/tests/test_forms.py b/lms/djangoapps/bulk_email/tests/test_forms.py index 863c4abe95..e9b03760d9 100644 --- a/lms/djangoapps/bulk_email/tests/test_forms.py +++ b/lms/djangoapps/bulk_email/tests/test_forms.py @@ -4,6 +4,7 @@ Unit tests for bulk-email-related forms. """ from django.conf import settings from mock import patch +from nose.plugins.attrib import attr from bulk_email.models import CourseAuthorization, CourseEmailTemplate from bulk_email.forms import CourseAuthorizationAdminForm, CourseEmailTemplateForm @@ -15,6 +16,7 @@ from xmodule.modulestore.django import modulestore from xmodule.modulestore import ModuleStoreEnum +@attr('shard_1') class CourseAuthorizationFormTest(ModuleStoreTestCase): """Test the CourseAuthorizationAdminForm form for Mongo-backed courses.""" diff --git a/lms/djangoapps/bulk_email/tests/test_models.py b/lms/djangoapps/bulk_email/tests/test_models.py index f8a7351922..a52fd137f2 100644 --- a/lms/djangoapps/bulk_email/tests/test_models.py +++ b/lms/djangoapps/bulk_email/tests/test_models.py @@ -8,11 +8,13 @@ from django.conf import settings from student.tests.factories import UserFactory from mock import patch, Mock +from nose.plugins.attrib import attr from bulk_email.models import CourseEmail, SEND_TO_STAFF, CourseEmailTemplate, CourseAuthorization from opaque_keys.edx.locations import SlashSeparatedCourseKey +@attr('shard_1') @patch('bulk_email.models.html_to_text', Mock(return_value='Mocking CourseEmail.text_message')) class CourseEmailTest(TestCase): """Test the CourseEmail model.""" @@ -57,6 +59,7 @@ class CourseEmailTest(TestCase): CourseEmail.create(course_id, sender, to_option, subject, html_message) +@attr('shard_1') class NoCourseEmailTemplateTest(TestCase): """Test the CourseEmailTemplate model without loading the template data.""" @@ -65,6 +68,7 @@ class NoCourseEmailTemplateTest(TestCase): CourseEmailTemplate.get_template() +@attr('shard_1') class CourseEmailTemplateTest(TestCase): """Test the CourseEmailTemplate model.""" @@ -134,6 +138,7 @@ class CourseEmailTemplateTest(TestCase): template.render_plaintext("My new plain text.", context) +@attr('shard_1') class CourseAuthorizationTest(TestCase): """Test the CourseAuthorization model.""" diff --git a/lms/djangoapps/bulk_email/tests/test_tasks.py b/lms/djangoapps/bulk_email/tests/test_tasks.py index 759025335a..19aee161ae 100644 --- a/lms/djangoapps/bulk_email/tests/test_tasks.py +++ b/lms/djangoapps/bulk_email/tests/test_tasks.py @@ -9,6 +9,7 @@ import json from uuid import uuid4 from itertools import cycle, chain, repeat from mock import patch, Mock +from nose.plugins.attrib import attr from smtplib import SMTPServerDisconnected, SMTPDataError, SMTPConnectError, SMTPAuthenticationError from boto.ses.exceptions import ( SESAddressNotVerifiedError, @@ -71,6 +72,7 @@ def my_update_subtask_status(entry_id, current_task_id, new_subtask_status): update_subtask_status(entry_id, current_task_id, new_subtask_status) +@attr('shard_1') @patch('bulk_email.models.html_to_text', Mock(return_value='Mocking CourseEmail.text_message')) class TestBulkEmailInstructorTask(InstructorTaskCourseTestCase): """Tests instructor task that send bulk email.""" diff --git a/lms/djangoapps/ccx/tests/test_models.py b/lms/djangoapps/ccx/tests/test_models.py index 4c2730648f..4162a8811e 100644 --- a/lms/djangoapps/ccx/tests/test_models.py +++ b/lms/djangoapps/ccx/tests/test_models.py @@ -4,6 +4,7 @@ tests for the models from datetime import datetime, timedelta from django.utils.timezone import UTC from mock import patch +from nose.plugins.attrib import attr from student.models import CourseEnrollment # pylint: disable=import-error from student.roles import CourseCcxCoachRole # pylint: disable=import-error from student.tests.factories import ( # pylint: disable=import-error @@ -29,6 +30,7 @@ from ..models import ( from ..overrides import override_field_for_ccx +@attr('shard_1') class TestCcxMembership(ModuleStoreTestCase): """Unit tests for the CcxMembership model """ @@ -135,6 +137,7 @@ class TestCcxMembership(ModuleStoreTestCase): self.assertTrue(self.has_ccx_future_membership(user)) +@attr('shard_1') class TestCCX(ModuleStoreTestCase): """Unit tests for the CustomCourseForEdX model """ diff --git a/lms/djangoapps/ccx/tests/test_overrides.py b/lms/djangoapps/ccx/tests/test_overrides.py index f6edd44a43..37a7a14d36 100644 --- a/lms/djangoapps/ccx/tests/test_overrides.py +++ b/lms/djangoapps/ccx/tests/test_overrides.py @@ -4,6 +4,7 @@ tests for overrides import datetime import mock import pytz +from nose.plugins.attrib import attr from courseware.field_overrides import OverrideFieldData # pylint: disable=import-error from django.test.utils import override_settings @@ -17,6 +18,7 @@ from ..overrides import override_field_for_ccx from .test_views import flatten, iter_blocks +@attr('shard_1') @override_settings(FIELD_OVERRIDE_PROVIDERS=( 'ccx.overrides.CustomCoursesForEdxOverrideProvider',)) class TestFieldOverrides(ModuleStoreTestCase): diff --git a/lms/djangoapps/ccx/tests/test_utils.py b/lms/djangoapps/ccx/tests/test_utils.py index cd44efe458..ca1fb6ac7c 100644 --- a/lms/djangoapps/ccx/tests/test_utils.py +++ b/lms/djangoapps/ccx/tests/test_utils.py @@ -1,6 +1,8 @@ """ test utils """ +from nose.plugins.attrib import attr + from ccx.models import ( # pylint: disable=import-error CcxMembership, CcxFutureMembership, @@ -21,6 +23,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory +@attr('shard_1') class TestEmailEnrollmentState(ModuleStoreTestCase): """unit tests for the EmailEnrollmentState class """ @@ -120,6 +123,7 @@ class TestEmailEnrollmentState(ModuleStoreTestCase): self.assertTrue(member in representation) +@attr('shard_1') # TODO: deal with changes in behavior for auto_enroll class TestGetEmailParams(ModuleStoreTestCase): """tests for ccx.utils.get_email_params @@ -176,6 +180,7 @@ class TestGetEmailParams(ModuleStoreTestCase): self.assertTrue(auto['auto_enroll']) +@attr('shard_1') # TODO: deal with changes in behavior for auto_enroll class TestEnrollEmail(ModuleStoreTestCase): """tests for the enroll_email function from ccx.utils @@ -356,6 +361,7 @@ class TestEnrollEmail(ModuleStoreTestCase): self.assertEqual(self.outbox, []) +@attr('shard_1') # TODO: deal with changes in behavior for auto_enroll class TestUnenrollEmail(ModuleStoreTestCase): """Tests for the unenroll_email function from ccx.utils""" @@ -504,6 +510,7 @@ class TestUnenrollEmail(ModuleStoreTestCase): self.assertEqual(self.outbox, []) +@attr('shard_1') class TestUserCCXList(ModuleStoreTestCase): """Unit tests for ccx.utils.get_all_ccx_for_user""" diff --git a/lms/djangoapps/ccx/tests/test_views.py b/lms/djangoapps/ccx/tests/test_views.py index b4c7e94883..85efd29d46 100644 --- a/lms/djangoapps/ccx/tests/test_views.py +++ b/lms/djangoapps/ccx/tests/test_views.py @@ -6,6 +6,7 @@ import json import re import pytz from mock import patch +from nose.plugins.attrib import attr from capa.tests.response_xml_factory import StringResponseXMLFactory from courseware.field_overrides import OverrideFieldData # pylint: disable=import-error @@ -55,6 +56,7 @@ def intercept_renderer(path, context): return response +@attr('shard_1') class TestCoachDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase): """ Tests for Custom Courses views. @@ -433,6 +435,7 @@ def patched_get_children(self, usage_key_filter=None): # pylint: disable=missin return list(iter_children()) +@attr('shard_1') @override_settings(FIELD_OVERRIDE_PROVIDERS=( 'ccx.overrides.CustomCoursesForEdxOverrideProvider',)) @patch('xmodule.x_module.XModuleMixin.get_children', patched_get_children, spec=True) @@ -584,6 +587,7 @@ class TestCCXGrades(ModuleStoreTestCase, LoginEnrollmentTestCase): self.assertEqual(len(grades['section_breakdown']), 4) +@attr('shard_1') class TestSwitchActiveCCX(ModuleStoreTestCase, LoginEnrollmentTestCase): """Verify the view for switching which CCX is active, if any """ diff --git a/lms/djangoapps/certificates/tests/test_api.py b/lms/djangoapps/certificates/tests/test_api.py index 3a6f2fae56..2ba4cc11ae 100644 --- a/lms/djangoapps/certificates/tests/test_api.py +++ b/lms/djangoapps/certificates/tests/test_api.py @@ -5,6 +5,7 @@ import ddt from django.test import TestCase, RequestFactory from django.test.utils import override_settings from mock import patch +from nose.plugins.attrib import attr from opaque_keys.edx.locator import CourseLocator from xmodule.modulestore.tests.factories import CourseFactory @@ -25,6 +26,7 @@ from certificates.queue import XQueueCertInterface, XQueueAddToQueueError from certificates.tests.factories import GeneratedCertificateFactory +@attr('shard_1') class CertificateDownloadableStatusTests(ModuleStoreTestCase): """Tests for the `certificate_downloadable_status` helper function. """ @@ -104,6 +106,7 @@ class CertificateDownloadableStatusTests(ModuleStoreTestCase): ) +@attr('shard_1') @override_settings(CERT_QUEUE='certificates') class GenerateUserCertificatesTest(ModuleStoreTestCase): """Tests for generating certificates for students. """ @@ -164,6 +167,7 @@ class GenerateUserCertificatesTest(ModuleStoreTestCase): yield mock_send_to_queue +@attr('shard_1') @ddt.ddt class CertificateGenerationEnabledTest(TestCase): """Test enabling/disabling self-generated certificates for a course. """ @@ -225,6 +229,7 @@ class CertificateGenerationEnabledTest(TestCase): self.assertEqual(expect_enabled, actual_enabled) +@attr('shard_1') class GenerateExampleCertificatesTest(TestCase): """Test generation of example certificates. """ diff --git a/lms/djangoapps/certificates/tests/test_create_fake_cert.py b/lms/djangoapps/certificates/tests/test_create_fake_cert.py index 47d615a1c5..1d2f95917e 100644 --- a/lms/djangoapps/certificates/tests/test_create_fake_cert.py +++ b/lms/djangoapps/certificates/tests/test_create_fake_cert.py @@ -1,6 +1,7 @@ """Tests for the create_fake_certs management command. """ from django.test import TestCase from django.core.management.base import CommandError +from nose.plugins.attrib import attr from opaque_keys.edx.locator import CourseLocator from student.tests.factories import UserFactory @@ -8,6 +9,7 @@ from certificates.management.commands import create_fake_cert from certificates.models import GeneratedCertificate +@attr('shard_1') class CreateFakeCertTest(TestCase): """Tests for the create_fake_certs management command. """ diff --git a/lms/djangoapps/certificates/tests/test_models.py b/lms/djangoapps/certificates/tests/test_models.py index e856984193..2829806a92 100644 --- a/lms/djangoapps/certificates/tests/test_models.py +++ b/lms/djangoapps/certificates/tests/test_models.py @@ -3,6 +3,7 @@ from django.conf import settings from django.core.exceptions import ValidationError from django.test import TestCase from django.test.utils import override_settings +from nose.plugins.attrib import attr from opaque_keys.edx.locator import CourseLocator from certificates.models import ( @@ -15,6 +16,7 @@ FEATURES_INVALID_FILE_PATH = settings.FEATURES.copy() FEATURES_INVALID_FILE_PATH['CERTS_HTML_VIEW_CONFIG_PATH'] = 'invalid/path/to/config.json' +@attr('shard_1') class ExampleCertificateTest(TestCase): """Tests for the ExampleCertificate model. """ @@ -80,6 +82,7 @@ class ExampleCertificateTest(TestCase): self.assertIs(result, None) +@attr('shard_1') class CertificateHtmlViewConfigurationTest(TestCase): """ Test the CertificateHtmlViewConfiguration model. diff --git a/lms/djangoapps/certificates/tests/test_queue.py b/lms/djangoapps/certificates/tests/test_queue.py index ee1843e739..a644aee5f2 100644 --- a/lms/djangoapps/certificates/tests/test_queue.py +++ b/lms/djangoapps/certificates/tests/test_queue.py @@ -3,6 +3,7 @@ from contextlib import contextmanager import json from mock import patch, Mock +from nose.plugins.attrib import attr from django.test import TestCase from django.test.utils import override_settings @@ -24,6 +25,7 @@ from certificates.queue import XQueueCertInterface from certificates.models import ExampleCertificateSet, ExampleCertificate +@attr('shard_1') @override_settings(CERT_QUEUE='certificates') class XQueueCertInterfaceAddCertificateTest(ModuleStoreTestCase): """Test the "add to queue" operation of the XQueue interface. """ @@ -53,6 +55,7 @@ class XQueueCertInterfaceAddCertificateTest(ModuleStoreTestCase): self.assertIn('https://edx.org/update_certificate?key=', actual_header['lms_callback_url']) +@attr('shard_1') @override_settings(CERT_QUEUE='certificates') class XQueueCertInterfaceExampleCertificateTest(TestCase): """Tests for the XQueue interface for certificate generation. """ diff --git a/lms/djangoapps/certificates/tests/test_resubmit_error_certificates.py b/lms/djangoapps/certificates/tests/test_resubmit_error_certificates.py index 564b02a968..d4e435cdbb 100644 --- a/lms/djangoapps/certificates/tests/test_resubmit_error_certificates.py +++ b/lms/djangoapps/certificates/tests/test_resubmit_error_certificates.py @@ -1,6 +1,7 @@ """Tests for the resubmit_error_certificates management command. """ import ddt from django.core.management.base import CommandError +from nose.plugins.attrib import attr from opaque_keys.edx.locator import CourseLocator from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase @@ -10,6 +11,7 @@ from certificates.management.commands import resubmit_error_certificates from certificates.models import GeneratedCertificate, CertificateStatuses +@attr('shard_1') @ddt.ddt class ResubmitErrorCertificatesTest(ModuleStoreTestCase): """Tests for the resubmit_error_certificates management command. """ diff --git a/lms/djangoapps/certificates/tests/test_views.py b/lms/djangoapps/certificates/tests/test_views.py index 7e031b912c..cbcacb18ac 100644 --- a/lms/djangoapps/certificates/tests/test_views.py +++ b/lms/djangoapps/certificates/tests/test_views.py @@ -3,6 +3,7 @@ import json import ddt from uuid import uuid4 +from nose.plugins.attrib import attr from django.conf import settings from django.core.cache import cache @@ -26,6 +27,7 @@ FEATURES_WITH_CERTS_DISABLED = settings.FEATURES.copy() FEATURES_WITH_CERTS_DISABLED['CERTIFICATES_HTML_VIEW'] = False +@attr('shard_1') @ddt.ddt class UpdateExampleCertificateViewTest(TestCase): """Tests for the XQueue callback that updates example certificates. """ @@ -167,6 +169,7 @@ class UpdateExampleCertificateViewTest(TestCase): self.assertEqual(content['return_code'], 0) +@attr('shard_1') class CertificatesViewsTests(ModuleStoreTestCase): """ Tests for the manual refund page diff --git a/lms/djangoapps/certificates/tests/tests.py b/lms/djangoapps/certificates/tests/tests.py index ff6af69e1d..e5e5a9980c 100644 --- a/lms/djangoapps/certificates/tests/tests.py +++ b/lms/djangoapps/certificates/tests/tests.py @@ -4,6 +4,7 @@ Tests for the certificates models. from ddt import ddt, data, unpack from mock import patch from django.conf import settings +from nose.plugins.attrib import attr from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase @@ -24,6 +25,7 @@ from util.milestones_helpers import ( ) +@attr('shard_1') @ddt class CertificatesModelTest(ModuleStoreTestCase): """ diff --git a/lms/djangoapps/class_dashboard/tests/test_dashboard_data.py b/lms/djangoapps/class_dashboard/tests/test_dashboard_data.py index 3afd9a84fe..782a75a7bf 100644 --- a/lms/djangoapps/class_dashboard/tests/test_dashboard_data.py +++ b/lms/djangoapps/class_dashboard/tests/test_dashboard_data.py @@ -7,6 +7,7 @@ import json from django.core.urlresolvers import reverse from django.test.client import RequestFactory from mock import patch +from nose.plugins.attrib import attr from capa.tests.response_xml_factory import StringResponseXMLFactory from courseware.tests.factories import StudentModuleFactory @@ -26,6 +27,7 @@ from class_dashboard.views import has_instructor_access_for_class USER_COUNT = 11 +@attr('shard_1') class TestGetProblemGradeDistribution(ModuleStoreTestCase): """ Tests related to class_dashboard/dashboard_data.py diff --git a/lms/djangoapps/class_dashboard/tests/test_views.py b/lms/djangoapps/class_dashboard/tests/test_views.py index 90de7c1f06..209ecb136a 100644 --- a/lms/djangoapps/class_dashboard/tests/test_views.py +++ b/lms/djangoapps/class_dashboard/tests/test_views.py @@ -5,6 +5,7 @@ import json from django.test.client import RequestFactory from mock import patch +from nose.plugins.attrib import attr from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase @@ -12,6 +13,7 @@ from class_dashboard import views from student.tests.factories import AdminFactory +@attr('shard_1') class TestViews(ModuleStoreTestCase): """ Tests related to class_dashboard/views.py diff --git a/lms/djangoapps/commerce/tests/test_views.py b/lms/djangoapps/commerce/tests/test_views.py index 1232f78c94..64399a9556 100644 --- a/lms/djangoapps/commerce/tests/test_views.py +++ b/lms/djangoapps/commerce/tests/test_views.py @@ -2,6 +2,7 @@ import json from uuid import uuid4 +from nose.plugins.attrib import attr from ddt import ddt, data from django.core.urlresolvers import reverse @@ -33,6 +34,7 @@ class UserMixin(object): self.client.login(username=self.user.username, password='test') +@attr('shard_1') @ddt @override_settings(ECOMMERCE_API_URL=TEST_API_URL, ECOMMERCE_API_SIGNING_KEY=TEST_API_SIGNING_KEY) class BasketsViewTests(EnrollmentEventTestMixin, UserMixin, ModuleStoreTestCase): @@ -303,6 +305,7 @@ class OrdersViewTests(BasketsViewTests): self.url = reverse('commerce:orders') +@attr('shard_1') @override_settings(ECOMMERCE_API_URL=TEST_API_URL, ECOMMERCE_API_SIGNING_KEY=TEST_API_SIGNING_KEY) class BasketOrderViewTests(UserMixin, TestCase): """ Tests for the basket order view. """ @@ -337,6 +340,7 @@ class BasketOrderViewTests(UserMixin, TestCase): self.assertEqual(response.status_code, 403) +@attr('shard_1') class ReceiptViewTests(TestCase): """ Tests for the receipt view. """ diff --git a/lms/djangoapps/course_wiki/tests/test_access.py b/lms/djangoapps/course_wiki/tests/test_access.py index aad975847f..c3a4a52d10 100644 --- a/lms/djangoapps/course_wiki/tests/test_access.py +++ b/lms/djangoapps/course_wiki/tests/test_access.py @@ -3,6 +3,7 @@ Tests for wiki permissions """ from django.contrib.auth.models import Group +from nose.plugins.attrib import attr from student.tests.factories import UserFactory from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase @@ -51,6 +52,7 @@ class TestWikiAccessBase(ModuleStoreTestCase): ] +@attr('shard_1') class TestWikiAccess(TestWikiAccessBase): """Test wiki access for course staff.""" def setUp(self): @@ -111,6 +113,7 @@ 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): @@ -126,6 +129,7 @@ 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): @@ -145,6 +149,7 @@ 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): diff --git a/lms/djangoapps/course_wiki/tests/test_middleware.py b/lms/djangoapps/course_wiki/tests/test_middleware.py index 881a703132..494b0c4ff2 100644 --- a/lms/djangoapps/course_wiki/tests/test_middleware.py +++ b/lms/djangoapps/course_wiki/tests/test_middleware.py @@ -3,6 +3,7 @@ Tests for wiki middleware. """ from django.test.client import Client +from nose.plugins.attrib import attr from wiki.models import URLPath from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase @@ -12,6 +13,7 @@ from courseware.tests.factories import InstructorFactory from course_wiki.views import get_or_create_root +@attr('shard_1') class TestWikiAccessMiddleware(ModuleStoreTestCase): """Tests for WikiAccessMiddleware.""" diff --git a/lms/djangoapps/course_wiki/tests/tests.py b/lms/djangoapps/course_wiki/tests/tests.py index 03b8d097f0..323753c89a 100644 --- a/lms/djangoapps/course_wiki/tests/tests.py +++ b/lms/djangoapps/course_wiki/tests/tests.py @@ -1,4 +1,5 @@ from django.core.urlresolvers import reverse +from nose.plugins.attrib import attr from courseware.tests.tests import LoginEnrollmentTestCase from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase @@ -7,6 +8,7 @@ from xmodule.modulestore.tests.factories import CourseFactory from mock import patch +@attr('shard_1') class WikiRedirectTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase): """ Tests for wiki course redirection. diff --git a/lms/djangoapps/courseware/management/commands/tests/test_clean_history.py b/lms/djangoapps/courseware/management/commands/tests/test_clean_history.py index cf12feab60..01026751c0 100644 --- a/lms/djangoapps/courseware/management/commands/tests/test_clean_history.py +++ b/lms/djangoapps/courseware/management/commands/tests/test_clean_history.py @@ -2,6 +2,7 @@ import fnmatch from mock import Mock +from nose.plugins.attrib import attr import os.path import textwrap @@ -138,6 +139,7 @@ class HistoryCleanerTest(TransactionTestCase): self.assertEqual(self.parse_rows(rows), self.read_history()) +@attr('shard_1') class HistoryCleanerNoDbTest(HistoryCleanerTest): """Tests of StudentModuleHistoryCleaner with db access mocked.""" @@ -208,6 +210,7 @@ class HistoryCleanerNoDbTest(HistoryCleanerTest): smhc.delete_history.assert_called_once_with([42, 23, 15, 8]) +@attr('shard_1') class HistoryCleanerWitDbTest(HistoryCleanerTest): """Tests of StudentModuleHistoryCleaner with a real db.""" @@ -394,6 +397,7 @@ class SmhcForTestingMain(SmhcSayStubbed): self.say("(not really committing)") +@attr('shard_1') class HistoryCleanerMainTest(HistoryCleanerTest): """Tests of StudentModuleHistoryCleaner.main(), using SmhcForTestingMain.""" diff --git a/lms/djangoapps/courseware/management/commands/tests/test_dump_course.py b/lms/djangoapps/courseware/management/commands/tests/test_dump_course.py index ef97b66e0b..9a04bb2505 100644 --- a/lms/djangoapps/courseware/management/commands/tests/test_dump_course.py +++ b/lms/djangoapps/courseware/management/commands/tests/test_dump_course.py @@ -3,6 +3,7 @@ """Tests for Django management commands""" import json +from nose.plugins.attrib import attr from path import path import shutil from StringIO import StringIO @@ -35,6 +36,7 @@ TEST_DATA_MIXED_XML_MODULESTORE = mixed_store_config( ) +@attr('shard_1') class CommandsTestBase(ModuleStoreTestCase): """ Base class for testing different django commands. diff --git a/lms/djangoapps/courseware/tests/test_about.py b/lms/djangoapps/courseware/tests/test_about.py index d2a171548e..6d19bccc4a 100644 --- a/lms/djangoapps/courseware/tests/test_about.py +++ b/lms/djangoapps/courseware/tests/test_about.py @@ -8,6 +8,7 @@ from django.conf import settings from django.core.urlresolvers import reverse from django.test.utils import override_settings from mock import patch +from nose.plugins.attrib import attr from opaque_keys.edx.locations import SlashSeparatedCourseKey from course_modes.models import CourseMode @@ -32,6 +33,7 @@ REG_STR = "