Simplify how shards are selected in CI

This commit is contained in:
Calen Pennington
2016-04-27 16:46:48 -04:00
parent e641c0dcee
commit bc20a37c2b
230 changed files with 605 additions and 637 deletions

View File

@@ -27,7 +27,7 @@ from util.testing import UrlResetMixin
from openedx.core.djangoapps.theming.tests.test_util import with_comprehensive_theme
@attr('shard_3')
@attr(shard=3)
@ddt.ddt
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
class CourseModeViewTest(UrlResetMixin, ModuleStoreTestCase):

View File

@@ -38,7 +38,7 @@ from mock import patch
MODULESTORE_CONFIG = mixed_store_config(settings.COMMON_TEST_DATA_ROOT, {})
@attr('shard_3')
@attr(shard=3)
@ddt.ddt
@override_settings(MODULESTORE=MODULESTORE_CONFIG)
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')

View File

@@ -21,7 +21,7 @@ from embargo.models import RestrictedCourse, IPFilter
from embargo.test_utils import restrict_course
@attr('shard_3')
@attr(shard=3)
@ddt.ddt
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
class EmbargoMiddlewareAccessTests(UrlResetMixin, ModuleStoreTestCase):

View File

@@ -126,7 +126,7 @@ class EnrollmentTestMixin(object):
self.assertEqual(actual_mode, expected_mode)
@attr('shard_3')
@attr(shard=3)
@override_settings(EDX_API_KEY="i am a key")
@ddt.ddt
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')

View File

@@ -73,7 +73,7 @@ def gen_all_identities():
yield _build_identity_dict(mail, display_name, given_name, surname)
@attr('shard_3')
@attr(shard=3)
@ddt
@override_settings(SESSION_ENGINE='django.contrib.sessions.backends.cache')
class ShibSPTest(CacheIsolationTestCase):

View File

@@ -21,7 +21,7 @@ from student.roles import (
)
@attr('shard_3')
@attr(shard=3)
@ddt.ddt
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
class EnrollmentTest(UrlResetMixin, SharedModuleStoreTestCase):

View File

@@ -20,7 +20,7 @@ from student.views import get_course_enrollments, _get_recently_enrolled_courses
from common.test.utils import XssTestMixin
@attr('shard_3')
@attr(shard=3)
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
@ddt.ddt
class TestRecentEnrollments(ModuleStoreTestCase, XssTestMixin):

View File

@@ -25,7 +25,7 @@ from lms.djangoapps.verify_student.models import VerificationDeadline, SoftwareS
from util.testing import UrlResetMixin
@attr('shard_3')
@attr(shard=3)
@patch.dict(settings.FEATURES, {'AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING': True})
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
@ddt.ddt

View File

@@ -890,7 +890,7 @@ class AnonymousLookupTable(ModuleStoreTestCase):
# TODO: Clean up these tests so that they use program factories and don't mention XSeries!
@attr('shard_3')
@attr(shard=3)
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
@ddt.ddt
class DashboardTestXSeriesPrograms(ModuleStoreTestCase, ProgramsApiConfigMixin):

View File

@@ -37,7 +37,7 @@ def expect_failure_with_message(message):
return test_decorator
@attr('shard_3')
@attr(shard=3)
@ddt
@override_settings(
TRACKING_SEGMENTIO_WEBHOOK_SECRET=SECRET,

View File

@@ -21,7 +21,7 @@ import unicodecsv
import uuid
@attr('shard_8')
@attr(shard=8)
class CohortConfigurationTest(EventsTestMixin, UniqueCourseTest, CohortTestMixin):
"""
Tests for cohort management on the LMS Instructor Dashboard
@@ -690,7 +690,7 @@ class CohortConfigurationTest(EventsTestMixin, UniqueCourseTest, CohortTestMixin
self.assertEquals(expected_message, messages[0])
@attr('shard_6')
@attr(shard=6)
class CohortDiscussionTopicsTest(UniqueCourseTest, CohortTestMixin):
"""
Tests for cohorting the inline and course-wide discussion topics.
@@ -981,7 +981,7 @@ class CohortDiscussionTopicsTest(UniqueCourseTest, CohortTestMixin):
self.verify_discussion_topics_after_reload(self.inline_key, cohorted_topics_after)
@attr('shard_6')
@attr(shard=6)
class CohortContentGroupAssociationTest(UniqueCourseTest, CohortTestMixin):
"""
Tests for linking between content groups and cohort in the instructor dashboard.

View File

@@ -79,7 +79,7 @@ class DiscussionTabSingleThreadTest(BaseDiscussionTestCase):
self.thread_page.wait_for_page()
@attr('shard_5')
@attr(shard=5)
class CohortedDiscussionTabSingleThreadTest(DiscussionTabSingleThreadTest, CohortedDiscussionTestMixin):
"""
Tests for the discussion page displaying a single cohorted thread.
@@ -88,7 +88,7 @@ class CohortedDiscussionTabSingleThreadTest(DiscussionTabSingleThreadTest, Cohor
pass
@attr('shard_5')
@attr(shard=5)
class NonCohortedDiscussionTabSingleThreadTest(DiscussionTabSingleThreadTest, NonCohortedDiscussionTestMixin):
"""
Tests for the discussion page displaying a single non-cohorted thread.
@@ -137,7 +137,7 @@ class InlineDiscussionTest(UniqueCourseTest):
self.show_thread(thread_id)
@attr('shard_5')
@attr(shard=5)
class CohortedInlineDiscussionTest(InlineDiscussionTest, CohortedDiscussionTestMixin):
"""
Tests for cohorted inline discussions.
@@ -146,7 +146,7 @@ class CohortedInlineDiscussionTest(InlineDiscussionTest, CohortedDiscussionTestM
pass
@attr('shard_5')
@attr(shard=5)
class NonCohortedInlineDiscussionTest(InlineDiscussionTest, NonCohortedDiscussionTestMixin):
"""
Tests for non-cohorted inline discussions.

View File

@@ -178,7 +178,7 @@ class DiscussionResponsePaginationTestMixin(BaseDiscussionMixin):
self.assertFalse(self.thread_page.has_add_response_button())
@attr('shard_2')
@attr(shard=2)
class DiscussionHomePageTest(UniqueCourseTest):
"""
Tests for the discussion home page.
@@ -217,7 +217,7 @@ class DiscussionHomePageTest(UniqueCourseTest):
self.page.a11y_audit.check_for_accessibility_errors()
@attr('shard_2')
@attr(shard=2)
class DiscussionTabSingleThreadTest(BaseDiscussionTestCase, DiscussionResponsePaginationTestMixin):
"""
Tests for the discussion page displaying a single thread
@@ -290,7 +290,7 @@ class DiscussionTabSingleThreadTest(BaseDiscussionTestCase, DiscussionResponsePa
self.assertFalse(self.thread_page.is_show_comments_visible(response_id))
@attr('shard_2')
@attr(shard=2)
class DiscussionTabMultipleThreadTest(BaseDiscussionTestCase):
"""
Tests for the discussion page with multiple threads
@@ -371,7 +371,7 @@ class DiscussionTabMultipleThreadTest(BaseDiscussionTestCase):
self.thread_page_2.a11y_audit.check_for_accessibility_errors()
@attr('shard_2')
@attr(shard=2)
class DiscussionOpenClosedThreadTest(BaseDiscussionTestCase):
"""
Tests for checking the display of attributes on open and closed threads
@@ -446,7 +446,7 @@ class DiscussionOpenClosedThreadTest(BaseDiscussionTestCase):
page.a11y_audit.check_for_accessibility_errors()
@attr('shard_2')
@attr(shard=2)
class DiscussionCommentDeletionTest(BaseDiscussionTestCase):
"""
Tests for deleting comments displayed beneath responses in the single thread view.
@@ -486,7 +486,7 @@ class DiscussionCommentDeletionTest(BaseDiscussionTestCase):
page.delete_comment("comment_other_author")
@attr('shard_2')
@attr(shard=2)
class DiscussionResponseEditTest(BaseDiscussionTestCase):
"""
Tests for editing responses displayed beneath thread in the single thread view.
@@ -737,7 +737,7 @@ class DiscussionResponseEditTest(BaseDiscussionTestCase):
page.a11y_audit.check_for_accessibility_errors()
@attr('shard_2')
@attr(shard=2)
class DiscussionCommentEditTest(BaseDiscussionTestCase):
"""
Tests for editing comments displayed beneath responses in the single thread view.
@@ -837,7 +837,7 @@ class DiscussionCommentEditTest(BaseDiscussionTestCase):
page.a11y_audit.check_for_accessibility_errors()
@attr('shard_2')
@attr(shard=2)
class InlineDiscussionTest(UniqueCourseTest, DiscussionResponsePaginationTestMixin):
"""
Tests for inline discussions
@@ -996,7 +996,7 @@ class InlineDiscussionTest(UniqueCourseTest, DiscussionResponsePaginationTestMix
self.assertFalse(self.additional_discussion_page._is_element_visible(".new-post-article"))
@attr('shard_2')
@attr(shard=2)
class DiscussionUserProfileTest(UniqueCourseTest):
"""
Tests for user profile page in discussion tab.
@@ -1125,7 +1125,7 @@ class DiscussionUserProfileTest(UniqueCourseTest):
self.assertTrue(learner_profile_page.field_is_visible('username'))
@attr('shard_2')
@attr(shard=2)
class DiscussionSearchAlertTest(UniqueCourseTest):
"""
Tests for spawning and dismissing alerts related to user search actions and their results.
@@ -1211,7 +1211,7 @@ class DiscussionSearchAlertTest(UniqueCourseTest):
self.page.a11y_audit.check_for_accessibility_errors()
@attr('shard_2')
@attr(shard=2)
class DiscussionSortPreferenceTest(UniqueCourseTest):
"""
Tests for the discussion page displaying a single thread.

View File

@@ -90,7 +90,7 @@ class AccountSettingsTestMixin(EventsTestMixin, WebAppTest):
self.assert_no_matching_events_were_emitted({'event_type': self.USER_SETTINGS_CHANGED_EVENT_NAME})
@attr('shard_8')
@attr(shard=8)
class DashboardMenuTest(AccountSettingsTestMixin, WebAppTest):
"""
Tests that the dashboard menu works correctly with the account settings page.
@@ -113,7 +113,7 @@ class DashboardMenuTest(AccountSettingsTestMixin, WebAppTest):
dashboard_page.click_account_settings_link()
@attr('shard_8')
@attr(shard=8)
class AccountSettingsPageTest(AccountSettingsTestMixin, WebAppTest):
"""
Tests that verify behaviour of the Account Settings page.

View File

@@ -60,7 +60,7 @@ class BookmarksTestMixin(EventsTestMixin, UniqueCourseTest):
self.assert_events_match(event_data, actual_events)
@attr('shard_8')
@attr(shard=8)
class BookmarksTest(BookmarksTestMixin):
"""
Tests to verify bookmarks functionality.

View File

@@ -10,7 +10,7 @@ from common.test.acceptance.pages.lms.auto_auth import AutoAuthPage
from common.test.acceptance.pages.lms.ccx_dashboard_page import CoachDashboardPage
@attr('shard_7')
@attr(shard=7)
class CreateCCXCoachTest(EventsTestMixin, UniqueCourseTest):
"""
Test ccx end to end process.

View File

@@ -13,7 +13,7 @@ from common.test.acceptance.pages.lms.course_nav import CourseNavPage
from common.test.acceptance.pages.lms.progress import ProgressPage
@attr('shard_5')
@attr(shard=5)
class CertificateWebViewTest(EventsTestMixin, UniqueCourseTest):
"""
Tests for verifying certificate web view features
@@ -94,7 +94,7 @@ class CertificateWebViewTest(EventsTestMixin, UniqueCourseTest):
self.assert_events_match(expected_events, actual_events)
@attr('shard_5')
@attr(shard=5)
class CertificateProgressPageTest(UniqueCourseTest):
"""
Tests for verifying Certificate info on Progress tab of course page.

View File

@@ -180,7 +180,7 @@ class LearnerProfileTestMixin(EventsTestMixin):
return username, user_id
@attr('shard_4')
@attr(shard=4)
class OwnLearnerProfilePageTest(LearnerProfileTestMixin, WebAppTest):
"""
Tests that verify a student's own profile page.
@@ -695,7 +695,7 @@ class OwnLearnerProfilePageTest(LearnerProfileTestMixin, WebAppTest):
profile_page.upload_file(filename='image.jpg', wait_for_upload_button=False)
@attr('shard_4')
@attr(shard=4)
class DifferentUserLearnerProfilePageTest(LearnerProfileTestMixin, WebAppTest):
"""
Tests that verify viewing the profile page of a different user.

View File

@@ -21,7 +21,7 @@ SUBSECTION_NAME = 'Test Subsection'
UNIT_NAME = 'Test Unit'
@attr('shard_7')
@attr(shard=7)
class LibraryContentTestBase(UniqueCourseTest):
""" Base class for library content block tests """
USERNAME = "STUDENT_TESTER"
@@ -144,7 +144,7 @@ class LibraryContentTestBase(UniqueCourseTest):
@ddt.ddt
@attr('shard_7')
@attr(shard=7)
class LibraryContentTest(LibraryContentTestBase):
"""
Test courseware.
@@ -197,7 +197,7 @@ class LibraryContentTest(LibraryContentTestBase):
@ddt.ddt
@attr('shard_7')
@attr(shard=7)
class StudioLibraryContainerCapaFilterTest(LibraryContentTestBase, TestWithSearchIndexMixin):
"""
Test Library Content block in LMS

View File

@@ -42,7 +42,7 @@ from common.test.acceptance.pages.lms.course_wiki import CourseWikiPage, CourseW
from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc, CourseUpdateDesc
@attr('shard_8')
@attr(shard=8)
class ForgotPasswordPageTest(UniqueCourseTest):
"""
Test that forgot password forms is rendered if url contains 'forgot-password-modal'
@@ -84,7 +84,7 @@ class ForgotPasswordPageTest(UniqueCourseTest):
self.assertIn("Password Reset Email Sent", self.reset_password_page.get_success_message())
@attr('shard_8')
@attr(shard=8)
class LoginFromCombinedPageTest(UniqueCourseTest):
"""Test that we can log in using the combined login/registration page.
@@ -275,7 +275,7 @@ class LoginFromCombinedPageTest(UniqueCourseTest):
return (email, password)
@attr('shard_8')
@attr(shard=8)
class RegisterFromCombinedPageTest(UniqueCourseTest):
"""Test that we can register a new user from the combined login/registration page. """
@@ -398,7 +398,7 @@ class RegisterFromCombinedPageTest(UniqueCourseTest):
account_settings.wait_for_message(field_id, "Successfully unlinked")
@attr('shard_8')
@attr(shard=8)
class PayAndVerifyTest(EventsTestMixin, UniqueCourseTest):
"""Test that we can proceed through the payment and verification flow."""
def setUp(self):
@@ -537,7 +537,7 @@ class PayAndVerifyTest(EventsTestMixin, UniqueCourseTest):
self.assertEqual(enrollment_mode, 'verified')
@attr('shard_1')
@attr(shard=1)
class CourseWikiTest(UniqueCourseTest):
"""
Tests that verify the course wiki.
@@ -591,7 +591,7 @@ class CourseWikiTest(UniqueCourseTest):
self.assertEqual(content, actual_content)
@attr('shard_1')
@attr(shard=1)
class HighLevelTabTest(UniqueCourseTest):
"""
Tests that verify each of the high-level tabs available within a course.
@@ -748,7 +748,7 @@ class HighLevelTabTest(UniqueCourseTest):
self.assertIn(expected, actual_items)
@attr('shard_1')
@attr(shard=1)
class PDFTextBooksTabTest(UniqueCourseTest):
"""
Tests that verify each of the textbook tabs available within a course.
@@ -789,7 +789,7 @@ class PDFTextBooksTabTest(UniqueCourseTest):
self.tab_nav.go_to_tab("PDF Book {}".format(i))
@attr('shard_1')
@attr(shard=1)
class VisibleToStaffOnlyTest(UniqueCourseTest):
"""
Tests that content with visible_to_staff_only set to True cannot be viewed by students.
@@ -874,7 +874,7 @@ class VisibleToStaffOnlyTest(UniqueCourseTest):
self.assertEqual([u'Test Unit'], self.course_nav.sequence_items)
@attr('shard_1')
@attr(shard=1)
class TooltipTest(UniqueCourseTest):
"""
Tests that tooltips are displayed
@@ -919,7 +919,7 @@ class TooltipTest(UniqueCourseTest):
self.courseware_page.verify_tooltips_displayed()
@attr('shard_1')
@attr(shard=1)
class PreRequisiteCourseTest(UniqueCourseTest):
"""
Tests that pre-requisite course messages are displayed
@@ -1004,7 +1004,7 @@ class PreRequisiteCourseTest(UniqueCourseTest):
self.settings_page.save_changes()
@attr('shard_1')
@attr(shard=1)
class ProblemExecutionTest(UniqueCourseTest):
"""
Tests of problems.
@@ -1083,7 +1083,7 @@ class ProblemExecutionTest(UniqueCourseTest):
self.assertFalse(problem_page.is_correct())
@attr('shard_1')
@attr(shard=1)
class EntranceExamTest(UniqueCourseTest):
"""
Tests that course has an entrance exam.
@@ -1154,7 +1154,7 @@ class EntranceExamTest(UniqueCourseTest):
))
@attr('shard_1')
@attr(shard=1)
class NotLiveRedirectTest(UniqueCourseTest):
"""
Test that a banner is shown when the user is redirected to
@@ -1186,7 +1186,7 @@ class NotLiveRedirectTest(UniqueCourseTest):
)
@attr('shard_1')
@attr(shard=1)
class EnrollmentClosedRedirectTest(UniqueCourseTest):
"""
Test that a banner is shown when the user is redirected to the
@@ -1275,7 +1275,7 @@ class EnrollmentClosedRedirectTest(UniqueCourseTest):
self._assert_dashboard_message()
@attr('shard_1')
@attr(shard=1)
class LMSLanguageTest(UniqueCourseTest):
""" Test suite for the LMS Language """
def setUp(self):

View File

@@ -25,7 +25,7 @@ from common.test.acceptance.pages.lms.instructor_dashboard import InstructorDash
from bok_choy.promise import EmptyPromise
@attr('shard_1')
@attr(shard=1)
class CoursewareSearchCohortTest(ContainerBase):
"""
Test courseware search.

View File

@@ -16,7 +16,7 @@ from common.test.acceptance.pages.lms.courseware_search import CoursewareSearchP
from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc
@attr('shard_5')
@attr(shard=5)
class CoursewareSearchTest(UniqueCourseTest):
"""
Test courseware search.

View File

@@ -122,7 +122,7 @@ class EdxNotesTestMixin(UniqueCourseTest):
self.edxnotes_fixture.install()
@attr('shard_4')
@attr(shard=4)
class EdxNotesDefaultInteractionsTest(EdxNotesTestMixin):
"""
Tests for creation, editing, deleting annotations inside annotatable components in LMS.
@@ -338,7 +338,7 @@ class EdxNotesDefaultInteractionsTest(EdxNotesTestMixin):
self.assertTrue(note.has_sr_label(1, 3, "Tags (space-separated)"))
@attr('shard_4')
@attr(shard=4)
class EdxNotesPageTest(EventsTestMixin, EdxNotesTestMixin):
"""
Tests for Notes page.
@@ -1410,7 +1410,7 @@ class EdxNotesPageTest(EventsTestMixin, EdxNotesTestMixin):
)
@attr('shard_4')
@attr(shard=4)
class EdxNotesToggleSingleNoteTest(EdxNotesTestMixin):
"""
Tests for toggling single annotation.
@@ -1479,7 +1479,7 @@ class EdxNotesToggleSingleNoteTest(EdxNotesTestMixin):
self.assertTrue(note_2.is_visible)
@attr('shard_4')
@attr(shard=4)
class EdxNotesToggleNotesTest(EdxNotesTestMixin):
"""
Tests for toggling visibility of all notes.

View File

@@ -100,7 +100,7 @@ class BulkEmailTest(BaseInstructorDashboardTest):
self.send_email_page.a11y_audit.check_for_accessibility_errors()
@attr('shard_7')
@attr(shard=7)
class AutoEnrollmentWithCSVTest(BaseInstructorDashboardTest):
"""
End-to-end tests for Auto-Registration and enrollment functionality via CSV file.
@@ -218,7 +218,7 @@ class AutoEnrollmentWithCSVTest(BaseInstructorDashboardTest):
self.auto_enroll_section.a11y_audit.check_for_accessibility_errors()
@attr('shard_7')
@attr(shard=7)
class ProctoredExamsTest(BaseInstructorDashboardTest):
"""
End-to-end tests for Proctoring Sections of the Instructor Dashboard.
@@ -407,7 +407,7 @@ class ProctoredExamsTest(BaseInstructorDashboardTest):
self.assertFalse(exam_attempts_section.is_student_attempt_visible)
@attr('shard_7')
@attr(shard=7)
class EntranceExamGradeTest(BaseInstructorDashboardTest):
"""
Tests for Entrance exam specific student grading tasks.
@@ -606,7 +606,7 @@ class EntranceExamGradeTest(BaseInstructorDashboardTest):
self.assertTrue(self.student_admin_section.is_background_task_history_table_visible())
@attr('shard_7')
@attr(shard=7)
class DataDownloadsTest(BaseInstructorDashboardTest):
"""
Bok Choy tests for the "Data Downloads" tab.
@@ -724,7 +724,7 @@ class DataDownloadsTest(BaseInstructorDashboardTest):
self.data_download_section.a11y_audit.check_for_accessibility_errors()
@attr('shard_7')
@attr(shard=7)
@ddt.ddt
class CertificatesTest(BaseInstructorDashboardTest):
"""
@@ -1057,7 +1057,7 @@ class CertificatesTest(BaseInstructorDashboardTest):
self.certificates_section.a11y_audit.check_for_accessibility_errors()
@attr('shard_7')
@attr(shard=7)
class CertificateInvalidationTest(BaseInstructorDashboardTest):
"""
Tests for Certificates functionality on instructor dashboard.

View File

@@ -21,7 +21,7 @@ from common.test.acceptance.tests.studio.base_studio_test import ContainerBase
from common.test.acceptance.pages.studio.auto_auth import AutoAuthPage as StudioAutoAuthPage
@attr('shard_1')
@attr(shard=1)
class SplitTestCoursewareSearchTest(ContainerBase):
"""
Test courseware search on Split Test Module.

View File

@@ -17,7 +17,7 @@ from xmodule.partitions.partitions import Group
from textwrap import dedent
@attr('shard_3')
@attr(shard=3)
class StaffViewTest(UniqueCourseTest):
"""
Tests that verify the staff view.
@@ -55,7 +55,7 @@ class StaffViewTest(UniqueCourseTest):
return staff_page
@attr('shard_3')
@attr(shard=3)
class CourseWithoutContentGroupsTest(StaffViewTest):
"""
Setup for tests that have no content restricted to specific content groups.
@@ -86,7 +86,7 @@ class CourseWithoutContentGroupsTest(StaffViewTest):
)
@attr('shard_3')
@attr(shard=3)
class StaffViewToggleTest(CourseWithoutContentGroupsTest):
"""
Tests for the staff view toggle button.
@@ -103,7 +103,7 @@ class StaffViewToggleTest(CourseWithoutContentGroupsTest):
self.assertFalse(course_page.has_tab('Instructor'))
@attr('shard_3')
@attr(shard=3)
class StaffDebugTest(CourseWithoutContentGroupsTest):
"""
Tests that verify the staff debug info.
@@ -235,7 +235,7 @@ class StaffDebugTest(CourseWithoutContentGroupsTest):
'for user {}'.format(self.USERNAME), msg)
@attr('shard_3')
@attr(shard=3)
class CourseWithContentGroupsTest(StaffViewTest):
"""
Verifies that changing the "View this course as" selector works properly for content groups.

View File

@@ -138,7 +138,7 @@ class ProblemTypeTestMixin(object):
"""
can_submit_blank = False
@attr('shard_7')
@attr(shard=7)
def test_answer_correctly(self):
"""
Scenario: I can answer a problem correctly
@@ -174,7 +174,7 @@ class ProblemTypeTestMixin(object):
for event in expected_events:
self.wait_for_events(event_filter=event, number_of_matches=1)
@attr('shard_7')
@attr(shard=7)
def test_answer_incorrectly(self):
"""
Scenario: I can answer a problem incorrectly
@@ -194,7 +194,7 @@ class ProblemTypeTestMixin(object):
self.problem_page.click_check()
self.wait_for_status('incorrect')
@attr('shard_7')
@attr(shard=7)
def test_submit_blank_answer(self):
"""
Scenario: I can submit a blank answer
@@ -215,7 +215,7 @@ class ProblemTypeTestMixin(object):
self.problem_page.click_check()
self.wait_for_status('incorrect')
@attr('shard_7')
@attr(shard=7)
def test_cant_submit_blank_answer(self):
"""
Scenario: I can't submit a blank answer

View File

@@ -157,7 +157,7 @@ class TeamsTabBase(EventsTestMixin, UniqueCourseTest):
@ddt.ddt
@attr('shard_5')
@attr(shard=5)
class TeamsTabTest(TeamsTabBase):
"""
Tests verifying when the Teams tab is present.
@@ -303,7 +303,7 @@ class TeamsTabTest(TeamsTabBase):
self.assertTrue(self.teams_page.q(css=selector).visible)
@attr('shard_5')
@attr(shard=5)
class MyTeamsTest(TeamsTabBase):
"""
Tests for the "My Teams" tab of the Teams page.
@@ -367,7 +367,7 @@ class MyTeamsTest(TeamsTabBase):
self.assertEqual(self.my_teams_page.team_memberships[0], '4 / 10 Members')
@attr('shard_5')
@attr(shard=5)
@ddt.ddt
class BrowseTopicsTest(TeamsTabBase):
"""
@@ -602,7 +602,7 @@ class BrowseTopicsTest(TeamsTabBase):
self.topics_page.visit()
@attr('shard_5')
@attr(shard=5)
@ddt.ddt
class BrowseTeamsWithinTopicTest(TeamsTabBase):
"""
@@ -906,7 +906,7 @@ class BrowseTeamsWithinTopicTest(TeamsTabBase):
alert.accept()
@attr('shard_5')
@attr(shard=5)
class TeamFormActions(TeamsTabBase):
"""
Base class for create, edit, and delete team.
@@ -1619,7 +1619,7 @@ class EditMembershipTest(TeamFormActions):
self.edit_membership_helper(role, cancel=True)
@attr('shard_5')
@attr(shard=5)
@ddt.ddt
class TeamPageTest(TeamsTabBase):
"""Tests for viewing a specific team"""

View File

@@ -40,7 +40,7 @@ class ExportTestMixin(object):
self.assertTrue(is_tarball_mimetype)
@attr('shard_7')
@attr(shard=7)
class TestCourseExport(ExportTestMixin, StudioCourseTest):
"""
Export tests for courses.
@@ -63,7 +63,7 @@ class TestCourseExport(ExportTestMixin, StudioCourseTest):
self.assertEqual(self.export_page.header_text, 'Course Export')
@attr('shard_7')
@attr(shard=7)
class TestLibraryExport(ExportTestMixin, StudioLibraryTest):
"""
Export tests for libraries.
@@ -112,7 +112,7 @@ class BadExportMixin(object):
)
@attr('shard_7')
@attr(shard=7)
class TestLibraryBadExport(BadExportMixin, StudioLibraryTest):
"""
Verify exporting a bad library causes an error.
@@ -136,7 +136,7 @@ class TestLibraryBadExport(BadExportMixin, StudioLibraryTest):
)
@attr('shard_7')
@attr(shard=7)
class TestCourseBadExport(BadExportMixin, StudioCourseTest):
"""
Verify exporting a bad course causes an error.
@@ -168,7 +168,7 @@ class TestCourseBadExport(BadExportMixin, StudioCourseTest):
)
@attr('shard_7')
@attr(shard=7)
class ImportTestMixin(object):
"""
Tests to run for both course and library import pages.
@@ -283,7 +283,7 @@ class ImportTestMixin(object):
self.import_page.wait_for_tasks(fail_on='Updating')
@attr('shard_7')
@attr(shard=7)
class TestEntranceExamCourseImport(ImportTestMixin, StudioCourseTest):
"""
Tests the Course import page
@@ -329,7 +329,7 @@ class TestEntranceExamCourseImport(ImportTestMixin, StudioCourseTest):
)
@attr('shard_7')
@attr(shard=7)
class TestCourseImport(ImportTestMixin, StudioCourseTest):
"""
Tests the Course import page
@@ -399,7 +399,7 @@ class TestCourseImport(ImportTestMixin, StudioCourseTest):
self.assertFalse(self.import_page.is_timestamp_visible())
@attr('shard_7')
@attr(shard=7)
class TestLibraryImport(ImportTestMixin, StudioLibraryTest):
"""
Tests the Library import page

View File

@@ -72,7 +72,7 @@ class NestedVerticalTest(ContainerBase):
@skip("Flaky: 01/16/2015")
@attr('shard_1')
@attr(shard=1)
class DragAndDropTest(NestedVerticalTest):
"""
Tests of reordering within the container page.
@@ -152,7 +152,7 @@ class DragAndDropTest(NestedVerticalTest):
self.do_action_and_verify(add_new_components_and_rearrange, expected_ordering)
@attr('shard_1')
@attr(shard=1)
class AddComponentTest(NestedVerticalTest):
"""
Tests of adding a component to the container page.
@@ -192,7 +192,7 @@ class AddComponentTest(NestedVerticalTest):
self.add_and_verify(container_menu, expected_ordering)
@attr('shard_1')
@attr(shard=1)
class DuplicateComponentTest(NestedVerticalTest):
"""
Tests of duplicating a component on the container page.
@@ -238,7 +238,7 @@ class DuplicateComponentTest(NestedVerticalTest):
self.do_action_and_verify(duplicate_twice, expected_ordering)
@attr('shard_1')
@attr(shard=1)
class DeleteComponentTest(NestedVerticalTest):
"""
Tests of deleting a component from the container page.
@@ -261,7 +261,7 @@ class DeleteComponentTest(NestedVerticalTest):
self.delete_and_verify(group_a_item_1_delete_index, expected_ordering)
@attr('shard_1')
@attr(shard=1)
class EditContainerTest(NestedVerticalTest):
"""
Tests of editing a container.
@@ -312,7 +312,7 @@ class EditContainerTest(NestedVerticalTest):
self.assertEqual(component.student_content, "modified content")
@attr('shard_3')
@attr(shard=3)
class EditVisibilityModalTest(ContainerBase):
"""
Tests of the visibility settings modal for components on the unit
@@ -572,7 +572,7 @@ class EditVisibilityModalTest(ContainerBase):
self.verify_visibility_set(self.html_component, True)
@attr('shard_1')
@attr(shard=1)
class UnitPublishingTest(ContainerBase):
"""
Tests of the publishing control and related widgets on the Unit page.
@@ -1042,7 +1042,7 @@ class UnitPublishingTest(ContainerBase):
# self.assertEqual('discussion', self.courseware.xblock_component_type(1))
@attr('shard_3')
@attr(shard=3)
class DisplayNameTest(ContainerBase):
"""
Test consistent use of display_name_with_default
@@ -1079,7 +1079,7 @@ class DisplayNameTest(ContainerBase):
self.assertEqual(container.name, title_on_unit_page)
@attr('shard_3')
@attr(shard=3)
class ProblemCategoryTabsTest(ContainerBase):
"""
Test to verify tabs in problem category.

View File

@@ -10,7 +10,7 @@ from common.test.acceptance.pages.studio.index import DashboardPage
from common.test.acceptance.pages.studio.overview import CourseOutlinePage
@attr('shard_8')
@attr(shard=8)
class CreateCourseTest(WebAppTest):
"""
Test that we can create a new course the studio home page.

View File

@@ -10,7 +10,7 @@ from common.test.acceptance.pages.studio.users import CourseTeamPage
from common.test.acceptance.pages.studio.index import DashboardPage
@attr('shard_2')
@attr(shard=2)
class CourseTeamPageTest(StudioCourseTest):
""" As a course author, I want to be able to add others to my team """
def _make_user(self, username):

View File

@@ -13,7 +13,7 @@ from common.test.acceptance.pages.studio.library import LibraryEditPage
from common.test.acceptance.pages.studio.users import LibraryUsersPage
@attr('shard_2')
@attr(shard=2)
@ddt
class LibraryEditPageTest(StudioLibraryTest):
"""
@@ -186,7 +186,7 @@ class LibraryEditPageTest(StudioLibraryTest):
self.assertIn("Checkboxes", problem_block.name)
@attr('shard_2')
@attr(shard=2)
@ddt
class LibraryNavigationTest(StudioLibraryTest):
"""

View File

@@ -17,7 +17,7 @@ SUBSECTION_NAME = 'Test Subsection'
UNIT_NAME = 'Test Unit'
@attr('shard_5')
@attr(shard=5)
@ddt.ddt
class StudioLibraryContainerTest(StudioLibraryTest, UniqueCourseTest, TestWithSearchIndexMixin):
"""

View File

@@ -74,7 +74,7 @@ class CourseOutlineTest(StudioCourseTest):
verify_ordering(self, outline_page, expected_ordering)
@attr('shard_3')
@attr(shard=3)
class CourseOutlineDragAndDropTest(CourseOutlineTest):
"""
Tests of drag and drop within the outline page.
@@ -129,7 +129,7 @@ class CourseOutlineDragAndDropTest(CourseOutlineTest):
self.drag_and_verify(self.seq_1_vert_2_handle, self.chap_1_seq_2_handle, expected_ordering, course_outline_page)
@attr('shard_3')
@attr(shard=3)
class WarningMessagesTest(CourseOutlineTest):
"""
Feature: Warning messages on sections, subsections, and units
@@ -337,7 +337,7 @@ class WarningMessagesTest(CourseOutlineTest):
unit.toggle_staff_lock()
@attr('shard_3')
@attr(shard=3)
class EditingSectionsTest(CourseOutlineTest):
"""
Feature: Editing Release date, Due date and grading type.
@@ -493,7 +493,7 @@ class EditingSectionsTest(CourseOutlineTest):
self.assertIn(release_text, self.course_outline_page.section_at(0).subsection_at(0).release_date)
@attr('shard_3')
@attr(shard=3)
class StaffLockTest(CourseOutlineTest):
"""
Feature: Sections, subsections, and units can be locked and unlocked from the course outline.
@@ -875,7 +875,7 @@ class StaffLockTest(CourseOutlineTest):
self._remove_staff_lock_and_verify_warning(subsection, False)
@attr('shard_3')
@attr(shard=3)
class EditNamesTest(CourseOutlineTest):
"""
Feature: Click-to-edit section/subsection names
@@ -991,7 +991,7 @@ class EditNamesTest(CourseOutlineTest):
self.assertTrue(self.course_outline_page.section_at(0).is_collapsed)
@attr('shard_3')
@attr(shard=3)
class CreateSectionsTest(CourseOutlineTest):
"""
Feature: Create new sections/subsections/units
@@ -1078,7 +1078,7 @@ class CreateSectionsTest(CourseOutlineTest):
self.assertTrue(unit_page.is_inline_editing_display_name())
@attr('shard_3')
@attr(shard=3)
class DeleteContentTest(CourseOutlineTest):
"""
Feature: Deleting sections/subsections/units
@@ -1190,7 +1190,7 @@ class DeleteContentTest(CourseOutlineTest):
self.assertTrue(self.course_outline_page.has_no_content_message)
@attr('shard_3')
@attr(shard=3)
class ExpandCollapseMultipleSectionsTest(CourseOutlineTest):
"""
Feature: Courses with multiple sections can expand and collapse all sections.
@@ -1322,7 +1322,7 @@ class ExpandCollapseMultipleSectionsTest(CourseOutlineTest):
self.verify_all_sections(collapsed=False)
@attr('shard_3')
@attr(shard=3)
class ExpandCollapseSingleSectionTest(CourseOutlineTest):
"""
Feature: Courses with a single section can expand and collapse all sections.
@@ -1362,7 +1362,7 @@ class ExpandCollapseSingleSectionTest(CourseOutlineTest):
self.assertFalse(self.course_outline_page.section_at(0).subsection_at(1).is_collapsed)
@attr('shard_3')
@attr(shard=3)
class ExpandCollapseEmptyTest(CourseOutlineTest):
"""
Feature: Courses with no sections initially can expand and collapse all sections after addition.
@@ -1400,7 +1400,7 @@ class ExpandCollapseEmptyTest(CourseOutlineTest):
self.assertFalse(self.course_outline_page.section_at(0).is_collapsed)
@attr('shard_3')
@attr(shard=3)
class DefaultStatesEmptyTest(CourseOutlineTest):
"""
Feature: Misc course outline default states/actions when starting with an empty course
@@ -1425,7 +1425,7 @@ class DefaultStatesEmptyTest(CourseOutlineTest):
self.assertTrue(self.course_outline_page.bottom_add_section_button.is_present())
@attr('shard_3')
@attr(shard=3)
class DefaultStatesContentTest(CourseOutlineTest):
"""
Feature: Misc course outline default states/actions when starting with a course with content
@@ -1450,7 +1450,7 @@ class DefaultStatesContentTest(CourseOutlineTest):
self.assertEqual(courseware.xblock_component_type(2), 'discussion')
@attr('shard_3')
@attr(shard=3)
class UnitNavigationTest(CourseOutlineTest):
"""
Feature: Navigate to units
@@ -1471,7 +1471,7 @@ class UnitNavigationTest(CourseOutlineTest):
self.assertTrue(unit.is_browser_on_page)
@attr('shard_3')
@attr(shard=3)
class PublishSectionTest(CourseOutlineTest):
"""
Feature: Publish sections.
@@ -1597,7 +1597,7 @@ class PublishSectionTest(CourseOutlineTest):
return (section, subsection, unit)
@attr('shard_3')
@attr(shard=3)
class DeprecationWarningMessageTest(CourseOutlineTest):
"""
Feature: Verify deprecation warning message.
@@ -1763,7 +1763,7 @@ class DeprecationWarningMessageTest(CourseOutlineTest):
)
@attr('shard_4')
@attr(shard=4)
class SelfPacedOutlineTest(CourseOutlineTest):
"""Test the course outline for a self-paced course."""

View File

@@ -22,7 +22,7 @@ from textwrap import dedent
from xmodule.partitions.partitions import Group
@attr('shard_8')
@attr(shard=8)
class ContentGroupConfigurationTest(StudioCourseTest):
"""
Tests for content groups in the Group Configurations Page.
@@ -234,7 +234,7 @@ class ContentGroupConfigurationTest(StudioCourseTest):
).fulfill()
@attr('shard_8')
@attr(shard=8)
class AdvancedSettingsValidationTest(StudioCourseTest):
"""
Tests for validation feature in Studio's advanced settings tab
@@ -407,7 +407,7 @@ class AdvancedSettingsValidationTest(StudioCourseTest):
self.assertEquals(set(displayed_fields), set(expected_fields))
@attr('shard_1')
@attr(shard=1)
class ContentLicenseTest(StudioCourseTest):
"""
Tests for course-level licensing (that is, setting the license,

View File

@@ -13,7 +13,7 @@ from common.test.acceptance.pages.studio.settings_advanced import AdvancedSettin
from common.test.acceptance.tests.helpers import skip_if_browser
@attr('shard_8')
@attr(shard=8)
class CertificatesTest(StudioCourseTest):
"""
Tests for settings/certificates Page.

View File

@@ -19,7 +19,7 @@ from common.test.acceptance.tests.helpers import (
)
@attr('shard_4')
@attr(shard=4)
class StudioSettingsDetailsTest(StudioCourseTest):
"""Base class for settings and details page tests."""
@@ -37,7 +37,7 @@ class StudioSettingsDetailsTest(StudioCourseTest):
self.assertTrue(self.settings_detail.is_browser_on_page())
@attr('shard_4')
@attr(shard=4)
class SettingsMilestonesTest(StudioSettingsDetailsTest):
"""
Tests for milestones feature in Studio's settings tab
@@ -206,7 +206,7 @@ class SettingsMilestonesTest(StudioSettingsDetailsTest):
))
@attr('shard_4')
@attr(shard=4)
class CoursePacingTest(StudioSettingsDetailsTest):
"""Tests for setting a course to self-paced."""

View File

@@ -66,7 +66,7 @@ class SplitTestMixin(object):
Promise(missing_groups_button_not_present, "Add missing groups button should not be showing.").fulfill()
@attr('shard_2')
@attr(shard=2)
class SplitTest(ContainerBase, SplitTestMixin):
"""
Tests for creating and editing split test instances in Studio.
@@ -199,7 +199,7 @@ class SplitTest(ContainerBase, SplitTestMixin):
self.verify_groups(container, ['alpha'], [], verify_missing_groups_not_present=False)
@attr('shard_2')
@attr(shard=2)
class GroupConfigurationsNoSplitTest(StudioCourseTest):
"""
Tests how the Group Configuration page should look when the split_test module is not enabled.
@@ -224,7 +224,7 @@ class GroupConfigurationsNoSplitTest(StudioCourseTest):
self.assertFalse(self.group_configurations_page.experiment_group_sections_present)
@attr('shard_2')
@attr(shard=2)
class GroupConfigurationsTest(ContainerBase, SplitTestMixin):
"""
Tests that Group Configurations page works correctly with previously

View File

@@ -8,7 +8,7 @@ from common.test.acceptance.tests.helpers import disable_animations
from nose.plugins.attrib import attr
@attr('shard_2')
@attr(shard=2)
class TextbooksTest(StudioCourseTest):
"""
Test that textbook functionality is working properly on studio side

View File

@@ -21,8 +21,11 @@ from bok_choy.promise import EmptyPromise
from bok_choy.page_object import XSS_INJECTION
@attr('shard_5')
@attr(shard=5)
class EndToEndCohortedCoursewareTest(ContainerBase):
"""
End-to-end of cohorted courseware.
"""
def setUp(self, is_staff=True):

View File

@@ -7,7 +7,7 @@ from nose.plugins.attrib import attr
from common.test.acceptance.tests.video.test_studio_video_module import CMSVideoBaseTest
@attr('shard_6')
@attr(shard=6)
class VideoEditorTest(CMSVideoBaseTest):
"""
CMS Video Editor Test Class

View File

@@ -161,7 +161,7 @@ class CMSVideoBaseTest(UniqueCourseTest):
self.unit_page.xblocks[1].save_settings()
@attr('shard_4')
@attr(shard=4)
class CMSVideoTest(CMSVideoBaseTest):
"""
CMS Video Test Class

View File

@@ -22,7 +22,7 @@ from nose.plugins.attrib import attr
from common.test.acceptance.tests.video.test_studio_video_module import CMSVideoBaseTest
@attr('shard_6')
@attr(shard=6)
class VideoTranscriptTest(CMSVideoBaseTest):
"""
CMS Video Transcript Test Class

View File

@@ -149,7 +149,7 @@ class VideoEventsTest(VideoEventsTestMixin):
assert_events_equal(static_fields_pattern, load_video_event)
@attr('shard_8')
@attr(shard=8)
@ddt.ddt
class VideoBumperEventsTest(VideoEventsTestMixin):
""" Test bumper video event emission """

View File

@@ -7,7 +7,7 @@ from nose.plugins.attrib import attr
from common.test.acceptance.tests.video.test_studio_video_module import CMSVideoBaseTest
@attr('shard_5')
@attr(shard=5)
class VideoHandoutTest(CMSVideoBaseTest):
"""
CMS Video Handout Test Class

View File

@@ -12,7 +12,7 @@ from common.test.acceptance.pages.lms.courseware import CoursewarePage
from common.test.acceptance.fixtures.course import XBlockFixtureDesc
@attr('shard_2')
@attr(shard=2)
class VideoLicenseTest(StudioCourseTest):
"""
Tests for video module-level licensing (that is, setting the license,

View File

@@ -198,7 +198,7 @@ class VideoBaseTest(UniqueCourseTest):
self.video.wait_for_video_player_render()
@attr('shard_4')
@attr(shard=4)
class YouTubeVideoTest(VideoBaseTest):
""" Test YouTube Video Player """
@@ -935,7 +935,7 @@ class YouTubeVideoTest(VideoBaseTest):
execute_video_steps(tab1_video_names)
@attr('shard_4')
@attr(shard=4)
class YouTubeHtml5VideoTest(VideoBaseTest):
""" Test YouTube HTML5 Video Player """
@@ -957,7 +957,7 @@ class YouTubeHtml5VideoTest(VideoBaseTest):
self.assertTrue(self.video.is_video_rendered('youtube'))
@attr('shard_4')
@attr(shard=4)
class Html5VideoTest(VideoBaseTest):
""" Test HTML5 Video Player """
@@ -1143,7 +1143,7 @@ class Html5VideoTest(VideoBaseTest):
self.assertTrue(all([source in HTML5_SOURCES for source in self.video.sources]))
@attr('shard_4')
@attr(shard=4)
class YouTubeQualityTest(VideoBaseTest):
""" Test YouTube Video Quality Button """
@@ -1192,7 +1192,7 @@ class YouTubeQualityTest(VideoBaseTest):
self.video.wait_for(lambda: self.video.is_quality_button_active, 'waiting for quality button activation')
@attr('shard_4')
@attr(shard=4)
class DragAndDropTest(VideoBaseTest):
"""
Tests draggability of closed captions within videos.

View File

@@ -152,7 +152,7 @@ class TestUserCourseBadgeAssertions(UserAssertionTestCase):
self.check_assertion_structure(assertion, response['results'][0])
@attr('shard_3')
@attr(shard=3)
@ddt
class TestUserBadgeAssertionsByClass(UserAssertionTestCase):
"""

View File

@@ -29,7 +29,7 @@ def get_image(name):
return ImageFile(open(TEST_DATA_ROOT / 'badges' / name + '.png'))
@attr('shard_1')
@attr(shard=1)
class BadgeImageConfigurationTest(TestCase):
"""
Test the validation features of BadgeImageConfiguration.

View File

@@ -8,7 +8,7 @@ from nose.plugins.attrib import attr
from branding.models import BrandingInfoConfig
@attr('shard_1')
@attr(shard=1)
class BrandingInfoConfigTest(TestCase):
"""
Test the BrandingInfoConfig model.

View File

@@ -40,7 +40,7 @@ def mock_render_to_response(*args, **kwargs):
RENDER_MOCK = Mock(side_effect=mock_render_to_response)
@attr('shard_1')
@attr(shard=1)
class AnonymousIndexPageTest(ModuleStoreTestCase):
"""
Tests that anonymous users can access the '/' page, Need courses with start date
@@ -112,7 +112,7 @@ class AnonymousIndexPageTest(ModuleStoreTestCase):
self.assertEqual(response._headers.get("location")[1], "/login") # pylint: disable=protected-access
@attr('shard_1')
@attr(shard=1)
class PreRequisiteCourseCatalog(ModuleStoreTestCase, LoginEnrollmentTestCase, MilestonesTestCaseMixin):
"""
Test to simulate and verify fix for disappearing courses in
@@ -156,7 +156,7 @@ class PreRequisiteCourseCatalog(ModuleStoreTestCase, LoginEnrollmentTestCase, Mi
self.assertIn('course that has pre requisite', resp.content)
@attr('shard_1')
@attr(shard=1)
class IndexPageCourseCardsSortingTests(ModuleStoreTestCase):
"""
Test for Index page course cards sorting

View File

@@ -17,7 +17,7 @@ from xmodule.modulestore.tests.factories import CourseFactory
from bulk_email.models import BulkEmailFlag
@attr('shard_1')
@attr(shard=1)
@patch('bulk_email.models.html_to_text', Mock(return_value='Mocking CourseEmail.text_message', autospec=True))
class TestOptoutCourseEmails(ModuleStoreTestCase):
"""

View File

@@ -129,7 +129,7 @@ class EmailSendFromDashboardTestCase(SharedModuleStoreTestCase):
BulkEmailFlag.objects.all().delete()
@attr('shard_1')
@attr(shard=1)
@patch('bulk_email.models.html_to_text', Mock(return_value='Mocking CourseEmail.text_message', autospec=True))
class TestEmailSendFromDashboardMockedHtmlToText(EmailSendFromDashboardTestCase):
"""
@@ -442,7 +442,7 @@ class TestEmailSendFromDashboardMockedHtmlToText(EmailSendFromDashboardTestCase)
self.assertItemsEqual(outbox_contents, should_send_contents)
@attr('shard_1')
@attr(shard=1)
@skipIf(os.environ.get("TRAVIS") == 'true', "Skip this test in Travis CI.")
class TestEmailSendFromDashboard(EmailSendFromDashboardTestCase):
"""

View File

@@ -36,7 +36,7 @@ class EmailTestException(Exception):
pass
@attr('shard_1')
@attr(shard=1)
@patch('bulk_email.models.html_to_text', Mock(return_value='Mocking CourseEmail.text_message', autospec=True))
class TestEmailErrors(ModuleStoreTestCase):
"""

View File

@@ -12,7 +12,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
@attr('shard_1')
@attr(shard=1)
class CourseAuthorizationFormTest(ModuleStoreTestCase):
"""Test the CourseAuthorizationAdminForm form for Mongo-backed courses."""

View File

@@ -21,7 +21,7 @@ from openedx.core.djangoapps.course_groups.models import CourseCohort
from opaque_keys.edx.keys import CourseKey
@attr('shard_1')
@attr(shard=1)
@patch('bulk_email.models.html_to_text', Mock(return_value='Mocking CourseEmail.text_message', autospec=True))
class CourseEmailTest(TestCase):
"""Test the CourseEmail model."""
@@ -82,7 +82,7 @@ class CourseEmailTest(TestCase):
self.assertEqual(target.long_display(), 'Cohort: test cohort')
@attr('shard_1')
@attr(shard=1)
class NoCourseEmailTemplateTest(TestCase):
"""Test the CourseEmailTemplate model without loading the template data."""
@@ -91,7 +91,7 @@ class NoCourseEmailTemplateTest(TestCase):
CourseEmailTemplate.get_template()
@attr('shard_1')
@attr(shard=1)
class CourseEmailTemplateTest(TestCase):
"""Test the CourseEmailTemplate model."""
@@ -190,7 +190,7 @@ class CourseEmailTemplateTest(TestCase):
self.assertIn(context['name'], message)
@attr('shard_1')
@attr(shard=1)
class CourseAuthorizationTest(TestCase):
"""Test the CourseAuthorization model."""

View File

@@ -75,7 +75,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_3')
@attr(shard=3)
@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."""

View File

@@ -139,7 +139,7 @@ class CcxRestApiTest(CcxTestCase, APITestCase):
self.assertEqual(expected_field_errors, resp_dict_error)
@attr('shard_1')
@attr(shard=1)
@ddt.ddt
class CcxListTest(CcxRestApiTest):
"""
@@ -655,7 +655,7 @@ class CcxListTest(CcxRestApiTest):
self.assertEqual(course_user, ccx_user)
@attr('shard_1')
@attr(shard=1)
@ddt.ddt
class CcxDetailTest(CcxRestApiTest):
"""

View File

@@ -31,7 +31,7 @@ from lms.djangoapps.ccx.tests.factories import CcxFactory
from openedx.core.djangoapps.content.block_structure.api import get_course_in_cache
@attr('shard_3')
@attr(shard=3)
@mock.patch.dict(
'django.conf.settings.FEATURES',
{

View File

@@ -25,7 +25,7 @@ from ..overrides import override_field_for_ccx
@ddt.ddt
@attr('shard_1')
@attr(shard=1)
class TestCCX(ModuleStoreTestCase):
"""Unit tests for the CustomCourseForEdX model
"""

View File

@@ -26,7 +26,7 @@ from lms.djangoapps.ccx.overrides import override_field_for_ccx
from lms.djangoapps.ccx.tests.utils import flatten, iter_blocks
@attr('shard_1')
@attr(shard=1)
@override_settings(
XBLOCK_FIELD_DATA_WRAPPERS=['lms.djangoapps.courseware.field_overrides:OverrideModulestoreFieldData.wrap'],
MODULESTORE_FIELD_OVERRIDE_PROVIDERS=['ccx.overrides.CustomCoursesForEdxOverrideProvider'],

View File

@@ -37,7 +37,7 @@ from lms.djangoapps.ccx.tests.factories import CcxFactory
from lms.djangoapps.ccx.tests.utils import CcxTestCase
@attr('shard_1')
@attr(shard=1)
class TestGetCCXFromCCXLocator(ModuleStoreTestCase):
"""Verify that get_ccx_from_ccx_locator functions properly"""
MODULESTORE = TEST_DATA_SPLIT_MODULESTORE
@@ -70,7 +70,7 @@ class TestGetCCXFromCCXLocator(ModuleStoreTestCase):
self.assertEqual(result, ccx)
@attr('shard_1')
@attr(shard=1)
class TestGetCourseChapters(CcxTestCase):
"""
Tests for the `get_course_chapters` util function

View File

@@ -188,7 +188,7 @@ class TestAdminAccessCoachDashboard(CcxTestCase, LoginEnrollmentTestCase):
self.assertEqual(response.status_code, 403)
@attr('shard_1')
@attr(shard=1)
@override_settings(
XBLOCK_FIELD_DATA_WRAPPERS=['lms.djangoapps.courseware.field_overrides:OverrideModulestoreFieldData.wrap'],
MODULESTORE_FIELD_OVERRIDE_PROVIDERS=['ccx.overrides.CustomCoursesForEdxOverrideProvider'],
@@ -303,7 +303,7 @@ class TestCCXProgressChanges(CcxTestCase, LoginEnrollmentTestCase):
self.assert_progress_summary(ccx_course_key, due)
@attr('shard_1')
@attr(shard=1)
@ddt.ddt
class TestCoachDashboard(CcxTestCase, LoginEnrollmentTestCase):
"""
@@ -917,7 +917,7 @@ class TestCoachDashboard(CcxTestCase, LoginEnrollmentTestCase):
)
@attr('shard_1')
@attr(shard=1)
class TestCoachDashboardSchedule(CcxTestCase, LoginEnrollmentTestCase, ModuleStoreTestCase):
"""
Tests of the CCX Coach Dashboard which need to modify the course content.
@@ -1059,7 +1059,7 @@ def patched_get_children(self, usage_key_filter=None):
return list(iter_children())
@attr('shard_1')
@attr(shard=1)
@override_settings(
XBLOCK_FIELD_DATA_WRAPPERS=['lms.djangoapps.courseware.field_overrides:OverrideModulestoreFieldData.wrap'],
MODULESTORE_FIELD_OVERRIDE_PROVIDERS=['ccx.overrides.CustomCoursesForEdxOverrideProvider'],

View File

@@ -83,7 +83,7 @@ class WebCertificateTestMixin(object):
self.store.update_item(self.course, self.user.id)
@attr('shard_1')
@attr(shard=1)
class CertificateDownloadableStatusTests(WebCertificateTestMixin, ModuleStoreTestCase):
"""Tests for the `certificate_downloadable_status` helper function. """
@@ -203,7 +203,7 @@ class CertificateDownloadableStatusTests(WebCertificateTestMixin, ModuleStoreTes
)
@attr('shard_1')
@attr(shard=1)
@ddt.ddt
class CertificateisInvalid(WebCertificateTestMixin, ModuleStoreTestCase):
"""Tests for the `is_certificate_invalid` helper function. """
@@ -315,7 +315,7 @@ class CertificateisInvalid(WebCertificateTestMixin, ModuleStoreTestCase):
)
@attr('shard_1')
@attr(shard=1)
class CertificateGetTests(SharedModuleStoreTestCase):
"""Tests for the `test_get_certificate_for_user` helper function. """
@classmethod
@@ -402,7 +402,7 @@ class CertificateGetTests(SharedModuleStoreTestCase):
)
@attr('shard_1')
@attr(shard=1)
@override_settings(CERT_QUEUE='certificates')
class GenerateUserCertificatesTest(EventTestMixin, WebCertificateTestMixin, ModuleStoreTestCase):
"""Tests for generating certificates for students. """
@@ -494,7 +494,7 @@ class GenerateUserCertificatesTest(EventTestMixin, WebCertificateTestMixin, Modu
self.assertEqual(url, "")
@attr('shard_1')
@attr(shard=1)
@ddt.ddt
class CertificateGenerationEnabledTest(EventTestMixin, TestCase):
"""Test enabling/disabling self-generated certificates for a course. """
@@ -562,7 +562,7 @@ class CertificateGenerationEnabledTest(EventTestMixin, TestCase):
self.assertEqual(expect_enabled, actual_enabled)
@attr('shard_1')
@attr(shard=1)
class GenerateExampleCertificatesTest(TestCase):
"""Test generation of example certificates. """
@@ -650,7 +650,7 @@ def set_microsite(domain):
@override_settings(FEATURES=FEATURES_WITH_CERTS_ENABLED)
@attr('shard_1')
@attr(shard=1)
class CertificatesBrandingTest(TestCase):
"""Test certificates branding. """

View File

@@ -65,7 +65,7 @@ class CertificateManagementTest(ModuleStoreTestCase):
self.assertEqual(cert.status, expected_status)
@attr('shard_1')
@attr(shard=1)
@ddt.ddt
class ResubmitErrorCertificatesTest(CertificateManagementTest):
"""Tests for the resubmit_error_certificates management command. """
@@ -153,7 +153,7 @@ class ResubmitErrorCertificatesTest(CertificateManagementTest):
@ddt.ddt
@attr('shard_1')
@attr(shard=1)
class RegenerateCertificatesTest(CertificateManagementTest):
"""
Tests for regenerating certificates.
@@ -222,7 +222,7 @@ class RegenerateCertificatesTest(CertificateManagementTest):
self.assertFalse(mock_send_to_queue.called)
@attr('shard_1')
@attr(shard=1)
class UngenerateCertificatesTest(CertificateManagementTest):
"""
Tests for generating certificates.

View File

@@ -9,7 +9,7 @@ from certificates.management.commands import create_fake_cert
from certificates.models import GeneratedCertificate
@attr('shard_1')
@attr(shard=1)
class CreateFakeCertTest(TestCase):
"""Tests for the create_fake_certs management command. """

View File

@@ -40,7 +40,7 @@ PLATFORM_ROOT = TEST_DIR.parent.parent.parent.parent
TEST_DATA_ROOT = PLATFORM_ROOT / TEST_DATA_DIR
@attr('shard_1')
@attr(shard=1)
class ExampleCertificateTest(TestCase):
"""Tests for the ExampleCertificate model. """
@@ -106,7 +106,7 @@ class ExampleCertificateTest(TestCase):
self.assertIs(result, None)
@attr('shard_1')
@attr(shard=1)
class CertificateHtmlViewConfigurationTest(TestCase):
"""
Test the CertificateHtmlViewConfiguration model.
@@ -173,7 +173,7 @@ class CertificateHtmlViewConfigurationTest(TestCase):
self.assertEquals(self.config.get_config(), {})
@attr('shard_1')
@attr(shard=1)
class CertificateTemplateAssetTest(TestCase):
"""
Test Assets are uploading/saving successfully for CertificateTemplateAsset.
@@ -201,7 +201,7 @@ class CertificateTemplateAssetTest(TestCase):
self.assertEqual(certificate_template_asset.asset, 'certificate_template_assets/1/picture2.jpg')
@attr('shard_1')
@attr(shard=1)
class EligibleCertificateManagerTest(SharedModuleStoreTestCase):
"""
Test the GeneratedCertificate model's object manager for filtering
@@ -240,7 +240,7 @@ class EligibleCertificateManagerTest(SharedModuleStoreTestCase):
)
@attr('shard_1')
@attr(shard=1)
@ddt.ddt
class TestCertificateGenerationHistory(TestCase):
"""
@@ -306,7 +306,7 @@ class TestCertificateGenerationHistory(TestCase):
)
@attr('shard_1')
@attr(shard=1)
class CertificateInvalidationTest(SharedModuleStoreTestCase):
"""
Test for the Certificate Invalidation model.

View File

@@ -39,7 +39,7 @@ from lms.djangoapps.verify_student.tests.factories import SoftwareSecurePhotoVer
@ddt.ddt
@attr('shard_1')
@attr(shard=1)
@override_settings(CERT_QUEUE='certificates')
class XQueueCertInterfaceAddCertificateTest(ModuleStoreTestCase):
"""Test the "add to queue" operation of the XQueue interface. """
@@ -283,7 +283,7 @@ class XQueueCertInterfaceAddCertificateTest(ModuleStoreTestCase):
)
@attr('shard_1')
@attr(shard=1)
@override_settings(CERT_QUEUE='certificates')
class XQueueCertInterfaceExampleCertificateTest(TestCase):
"""Tests for the XQueue interface for certificate generation. """

View File

@@ -36,7 +36,7 @@ FEATURES_WITH_CUSTOM_CERTS_ENABLED = {
FEATURES_WITH_CUSTOM_CERTS_ENABLED.update(FEATURES_WITH_CERTS_ENABLED)
@attr('shard_1')
@attr(shard=1)
@ddt.ddt
class UpdateExampleCertificateViewTest(CacheIsolationTestCase):
"""Tests for the XQueue callback that updates example certificates. """
@@ -180,7 +180,7 @@ class UpdateExampleCertificateViewTest(CacheIsolationTestCase):
self.assertEqual(content['return_code'], 0)
@attr('shard_1')
@attr(shard=1)
class MicrositeCertificatesViewsTests(ModuleStoreTestCase):
"""
Tests for the microsite certificates web/html views

View File

@@ -171,7 +171,7 @@ class CommonCertificatesTestCase(ModuleStoreTestCase):
template.save()
@attr('shard_1')
@attr(shard=1)
@ddt.ddt
class CertificatesViewsTests(CommonCertificatesTestCase):
"""
@@ -1145,7 +1145,7 @@ class CertificatesViewsTests(CommonCertificatesTestCase):
)
@attr('shard_1')
@attr(shard=1)
class CertificateEventTests(CommonCertificatesTestCase, EventTrackingTestCase):
"""
Test events emitted by certificate handling.

View File

@@ -26,7 +26,7 @@ from util.milestones_helpers import (
from milestones.tests.utils import MilestonesTestCaseMixin
@attr('shard_1')
@attr(shard=1)
@ddt
class CertificatesModelTest(ModuleStoreTestCase, MilestonesTestCaseMixin):
"""

View File

@@ -27,7 +27,7 @@ from class_dashboard.views import has_instructor_access_for_class
USER_COUNT = 11
@attr('shard_1')
@attr(shard=1)
class TestGetProblemGradeDistribution(SharedModuleStoreTestCase):
"""
Tests related to class_dashboard/dashboard_data.py

View File

@@ -13,7 +13,7 @@ from class_dashboard import views
from student.tests.factories import AdminFactory
@attr('shard_1')
@attr(shard=1)
class TestViews(ModuleStoreTestCase):
"""
Tests related to class_dashboard/views.py

View File

@@ -30,7 +30,7 @@ from student.tests.tests import EnrollmentEventTestMixin
from xmodule.modulestore.django import modulestore
@attr('shard_1')
@attr(shard=1)
@ddt.ddt
@override_settings(ECOMMERCE_API_URL=TEST_API_URL, ECOMMERCE_API_SIGNING_KEY=TEST_API_SIGNING_KEY)
class BasketsViewTests(EnrollmentEventTestMixin, UserMixin, ModuleStoreTestCase):
@@ -362,7 +362,7 @@ class BasketsViewTests(EnrollmentEventTestMixin, UserMixin, ModuleStoreTestCase)
self.assertEqual(self._post_to_view().status_code, 406)
@attr('shard_1')
@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. """

View File

@@ -104,7 +104,7 @@ class CourseListViewTests(CourseApiViewTestMixin, ModuleStoreTestCase):
self.assertListEqual(actual, expected)
@attr('shard_3')
@attr(shard=3)
@ddt.ddt
class CourseRetrieveUpdateViewTests(CourseApiViewTestMixin, ModuleStoreTestCase):
""" Tests for CourseRetrieveUpdateView. """
@@ -390,7 +390,7 @@ class CourseRetrieveUpdateViewTests(CourseApiViewTestMixin, ModuleStoreTestCase)
self.assertDictEqual(expected_dict, json.loads(response.content))
@attr('shard_1')
@attr(shard=1)
@override_settings(ECOMMERCE_API_URL=TEST_API_URL, ECOMMERCE_API_SIGNING_KEY=TEST_API_SIGNING_KEY)
class OrderViewTests(UserMixin, TestCase):
""" Tests for the basket order view. """

View File

@@ -23,7 +23,7 @@ class UserMixin(object):
self.client.login(username=self.user.username, password='test')
@attr('shard_1')
@attr(shard=1)
@ddt.ddt
class ReceiptViewTests(UserMixin, TestCase):
""" Tests for the receipt view. """

View File

@@ -16,7 +16,7 @@ from ..milestones import MilestonesTransformer
from ...api import get_course_blocks
@attr('shard_3')
@attr(shard=3)
@ddt.ddt
@patch.dict('django.conf.settings.FEATURES', {'ENABLE_SPECIAL_EXAMS': True, 'MILESTONES_APP': True})
class MilestonesTransformerTestCase(CourseStructureTestCase, MilestonesTestCaseMixin):

View File

@@ -21,7 +21,7 @@ from ..serializers import CourseSerializer, CourseDetailSerializer
from .mixins import CourseApiFactoryMixin
@attr('shard_3')
@attr(shard=3)
@ddt.ddt
class TestCourseSerializer(CourseApiFactoryMixin, ModuleStoreTestCase):
"""

View File

@@ -47,7 +47,7 @@ class CourseApiTestViewMixin(CourseApiFactoryMixin):
return response
@attr('shard_3')
@attr(shard=3)
class CourseListViewTestCase(CourseApiTestViewMixin, SharedModuleStoreTestCase):
"""
Test responses returned from CourseListView.

View File

@@ -10,7 +10,7 @@ from ..hidden_content import HiddenContentTransformer
from .helpers import BlockParentsMapTestCase, update_block
@attr('shard_3')
@attr(shard=3)
@ddt.ddt
class HiddenContentTransformerTestCase(BlockParentsMapTestCase):
"""

View File

@@ -15,7 +15,7 @@ from ..user_partitions import UserPartitionTransformer, _get_user_partition_grou
from .helpers import CourseStructureTestCase, create_location
@attr('shard_3')
@attr(shard=3)
@ddt.ddt
class SplitTestTransformerTestCase(CourseStructureTestCase):
"""

View File

@@ -12,7 +12,7 @@ from ..start_date import StartDateTransformer, DEFAULT_START_DATE
from .helpers import BlockParentsMapTestCase, update_block
@attr('shard_3')
@attr(shard=3)
@ddt.ddt
class StartDateTransformerTestCase(BlockParentsMapTestCase):
"""

View File

@@ -68,7 +68,7 @@ class UserPartitionTestMixin(object):
self.partition_cohorts.append(partition_cohorts)
@attr('shard_3')
@attr(shard=3)
@ddt.ddt
class UserPartitionTransformerTestCase(UserPartitionTestMixin, CourseStructureTestCase):
"""
@@ -241,7 +241,7 @@ class UserPartitionTransformerTestCase(UserPartitionTestMixin, CourseStructureTe
)
@attr('shard_3')
@attr(shard=3)
@ddt.ddt
class MergedGroupAccessTestData(UserPartitionTestMixin, CourseStructureTestCase):
"""

View File

@@ -8,7 +8,7 @@ from ..visibility import VisibilityTransformer
from .helpers import BlockParentsMapTestCase, update_block
@attr('shard_3')
@attr(shard=3)
@ddt.ddt
class VisibilityTransformerTestCase(BlockParentsMapTestCase):
"""

View File

@@ -52,7 +52,7 @@ class TestWikiAccessBase(ModuleStoreTestCase):
]
@attr('shard_1')
@attr(shard=1)
class TestWikiAccess(TestWikiAccessBase):
"""Test wiki access for course staff."""
def setUp(self):
@@ -113,7 +113,7 @@ class TestWikiAccess(TestWikiAccessBase):
self.assertFalse(user_is_article_course_staff(course_staff, self.wiki_310b.article))
@attr('shard_1')
@attr(shard=1)
class TestWikiAccessForStudent(TestWikiAccessBase):
"""Test access for students."""
def setUp(self):
@@ -129,7 +129,7 @@ class TestWikiAccessForStudent(TestWikiAccessBase):
self.assertFalse(user_is_article_course_staff(self.student, page.article))
@attr('shard_1')
@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):
@@ -149,7 +149,7 @@ class TestWikiAccessForNumericalCourseNumber(TestWikiAccessBase):
self.assertTrue(user_is_article_course_staff(course_staff, page.article))
@attr('shard_1')
@attr(shard=1)
class TestWikiAccessForOldFormatCourseStaffGroups(TestWikiAccessBase):
"""Test staff has access if course group has old format."""
def setUp(self):

View File

@@ -14,7 +14,7 @@ from courseware.tests.factories import InstructorFactory
from course_wiki.views import get_or_create_root
@attr('shard_1')
@attr(shard=1)
class TestComprehensiveTheming(ModuleStoreTestCase):
"""Tests for comprehensive theming of wiki pages."""

View File

@@ -13,7 +13,7 @@ from courseware.tests.factories import InstructorFactory
from course_wiki.views import get_or_create_root
@attr('shard_1')
@attr(shard=1)
class TestWikiAccessMiddleware(ModuleStoreTestCase):
"""Tests for WikiAccessMiddleware."""

View File

@@ -8,7 +8,7 @@ from xmodule.modulestore.tests.factories import CourseFactory
from mock import patch
@attr('shard_1')
@attr(shard=1)
class WikiRedirectTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
"""
Tests for wiki course redirection.

View File

@@ -27,7 +27,7 @@ DATA_DIR = settings.COMMON_TEST_DATA_ROOT
XML_COURSE_DIRS = ['simple']
@attr('shard_1')
@attr(shard=1)
class CommandsTestBase(SharedModuleStoreTestCase):
"""
Base class for testing different django commands.

View File

@@ -41,7 +41,7 @@ REG_STR = "<form id=\"class_enroll_form\" method=\"post\" data-remote=\"true\" a
SHIB_ERROR_STR = "The currently logged-in user account does not have permission to enroll in this course."
@attr('shard_1')
@attr(shard=1)
class AboutTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase, EventTrackingTestCase, MilestonesTestCaseMixin):
"""
Tests about xblock.
@@ -195,7 +195,7 @@ class AboutTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase, EventTra
self.assertEqual(resp.status_code, 200)
@attr('shard_1')
@attr(shard=1)
class AboutTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
"""
Tests for the course about page
@@ -243,7 +243,7 @@ class AboutTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
self.assertIn(self.xml_data, resp.content)
@attr('shard_1')
@attr(shard=1)
class AboutWithCappedEnrollmentsTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase):
"""
This test case will check the About page when a course has a capped enrollment
@@ -296,7 +296,7 @@ class AboutWithCappedEnrollmentsTestCase(LoginEnrollmentTestCase, SharedModuleSt
self.assertNotIn(REG_STR, resp.content)
@attr('shard_1')
@attr(shard=1)
class AboutWithInvitationOnly(SharedModuleStoreTestCase):
"""
This test case will check the About page when a course is invitation only.
@@ -345,7 +345,7 @@ class AboutWithInvitationOnly(SharedModuleStoreTestCase):
self.assertIn(REG_STR, resp.content)
@attr('shard_1')
@attr(shard=1)
@patch.dict(settings.FEATURES, {'RESTRICT_ENROLL_BY_REG_METHOD': True})
class AboutTestCaseShibCourse(LoginEnrollmentTestCase, SharedModuleStoreTestCase):
"""
@@ -389,7 +389,7 @@ class AboutTestCaseShibCourse(LoginEnrollmentTestCase, SharedModuleStoreTestCase
self.assertIn(REG_STR, resp.content)
@attr('shard_1')
@attr(shard=1)
class AboutWithClosedEnrollment(ModuleStoreTestCase):
"""
This test case will check the About page for a course that has enrollment start/end
@@ -432,7 +432,7 @@ class AboutWithClosedEnrollment(ModuleStoreTestCase):
self.assertNotIn('<span class="important-dates-item-text">$10</span>', resp.content)
@attr('shard_1')
@attr(shard=1)
@patch.dict(settings.FEATURES, {'ENABLE_SHOPPING_CART': True})
@patch.dict(settings.FEATURES, {'ENABLE_PAID_COURSE_REGISTRATION': True})
class AboutPurchaseCourseTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase):

View File

@@ -143,7 +143,7 @@ class CoachAccessTestCaseCCX(SharedModuleStoreTestCase, LoginEnrollmentTestCase)
self.assertEqual(resp.status_code, 404)
@attr('shard_1')
@attr(shard=1)
@ddt.ddt
class AccessTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase, MilestonesTestCaseMixin):
"""
@@ -608,7 +608,7 @@ class AccessTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase, MilestonesTes
self.assertEqual(response.status_code, 200)
@attr('shard_1')
@attr(shard=1)
class UserRoleTestCase(TestCase):
"""
Tests for user roles.
@@ -665,7 +665,7 @@ class UserRoleTestCase(TestCase):
)
@attr('shard_3')
@attr(shard=3)
@ddt.ddt
class CourseOverviewAccessTestCase(ModuleStoreTestCase):
"""

View File

@@ -30,7 +30,7 @@ from .helpers import LoginEnrollmentTestCase
from lms.djangoapps.ccx.tests.factories import CcxFactory
@attr('shard_1')
@attr(shard=1)
class CourseInfoTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase):
"""
Tests for the Course Info page
@@ -98,7 +98,7 @@ class CourseInfoTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase):
self.assertEqual(response.status_code, 404)
@attr('shard_1')
@attr(shard=1)
class CourseInfoLastAccessedTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
"""
Tests of the CourseInfo last accessed link.
@@ -146,7 +146,7 @@ class CourseInfoLastAccessedTestCase(LoginEnrollmentTestCase, ModuleStoreTestCas
self.assertEqual(content('.page-header-secondary .last-accessed-link').attr('href'), section_url)
@attr('shard_1')
@attr(shard=1)
class CourseInfoTitleTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
"""
Tests of the CourseInfo page title.
@@ -236,7 +236,7 @@ class CourseInfoTestCaseCCX(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
self.assertRedirects(response, expected, status_code=302, target_status_code=200)
@attr('shard_1')
@attr(shard=1)
class CourseInfoTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
"""
Tests for the Course Info page for an XML course
@@ -284,7 +284,7 @@ class CourseInfoTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
self.assertNotIn(self.xml_data, resp.content)
@attr('shard_1')
@attr(shard=1)
@override_settings(FEATURES=dict(settings.FEATURES, EMBARGO=False))
class SelfPacedCourseInfoTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase):
"""

View File

@@ -17,7 +17,7 @@ from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from courseware.tests.helpers import LoginEnrollmentTestCase
@attr('shard_1')
@attr(shard=1)
class SurveyViewsTests(LoginEnrollmentTestCase, SharedModuleStoreTestCase, XssTestMixin):
"""
All tests for the views.py file

View File

@@ -43,7 +43,7 @@ CMS_BASE_TEST = 'testcms'
TEST_DATA_DIR = settings.COMMON_TEST_DATA_ROOT
@attr('shard_1')
@attr(shard=1)
@ddt.ddt
class CoursesTest(ModuleStoreTestCase):
"""Test methods related to fetching courses."""
@@ -160,7 +160,7 @@ class CoursesTest(ModuleStoreTestCase):
)
@attr('shard_1')
@attr(shard=1)
class ModuleStoreBranchSettingTest(ModuleStoreTestCase):
"""Test methods related to the modulestore branch setting."""
@mock.patch(
@@ -186,7 +186,7 @@ class ModuleStoreBranchSettingTest(ModuleStoreTestCase):
self.assertEqual(_get_modulestore_branch_setting(), 'fake_default_branch')
@attr('shard_1')
@attr(shard=1)
@override_settings(CMS_BASE=CMS_BASE_TEST)
class MongoCourseImageTestCase(ModuleStoreTestCase):
"""Tests for course image URLs when using a mongo modulestore."""
@@ -242,7 +242,7 @@ class MongoCourseImageTestCase(ModuleStoreTestCase):
)
@attr('shard_1')
@attr(shard=1)
class XmlCourseImageTestCase(XModuleXmlImportTest):
"""Tests for course image URLs when using an xml modulestore."""
@@ -260,7 +260,7 @@ class XmlCourseImageTestCase(XModuleXmlImportTest):
self.assertEquals(course_image_url(course), u'/static/xml_test_course/before after.jpg')
@attr('shard_1')
@attr(shard=1)
class CoursesRenderTest(ModuleStoreTestCase):
"""Test methods related to rendering courses content."""
@@ -306,7 +306,7 @@ class CoursesRenderTest(ModuleStoreTestCase):
self.assertIn("this module is temporarily unavailable", course_about)
@attr('shard_1')
@attr(shard=1)
@ddt.ddt
class CourseInstantiationTests(ModuleStoreTestCase):
"""

View File

@@ -29,7 +29,7 @@ from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
@attr('shard_1')
@attr(shard=1)
@ddt.ddt
class CourseDateSummaryTest(SharedModuleStoreTestCase):
"""Tests for course date summary blocks."""

View File

@@ -5,7 +5,7 @@ from xmodule.modulestore.django import modulestore
from opaque_keys.edx.locations import SlashSeparatedCourseKey
@attr('shard_1')
@attr(shard=1)
class TestDraftModuleStore(TestCase):
"""
Test the draft modulestore

View File

@@ -38,7 +38,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
@attr('shard_2')
@attr(shard=2)
@patch.dict('django.conf.settings.FEATURES', {'ENTRANCE_EXAMS': True, 'MILESTONES_APP': True})
class EntranceExamTestCases(LoginEnrollmentTestCase, ModuleStoreTestCase, MilestonesTestCaseMixin):
"""

View File

@@ -6,7 +6,7 @@ from nose.plugins.attrib import attr
from util.testing import UrlResetMixin
@attr('shard_1')
@attr(shard=1)
class FaviconTestCase(UrlResetMixin, TestCase):
"""
Tests of the courseware favicon.

View File

@@ -45,7 +45,7 @@ class TestOverrideProvider(FieldOverrideProvider):
return True
@attr('shard_1')
@attr(shard=1)
@override_settings(FIELD_OVERRIDE_PROVIDERS=(
'courseware.tests.test_field_overrides.TestOverrideProvider',))
class OverrideFieldDataTests(SharedModuleStoreTestCase):
@@ -125,7 +125,7 @@ class OverrideFieldDataTests(SharedModuleStoreTestCase):
self.assertIsInstance(data, DictFieldData)
@attr('shard_1')
@attr(shard=1)
@override_settings(
MODULESTORE_FIELD_OVERRIDE_PROVIDERS=['courseware.tests.test_field_overrides.TestOverrideProvider']
)
@@ -142,7 +142,7 @@ class OverrideModulestoreFieldDataTests(FieldOverrideTestMixin, OverrideFieldDat
self.assertIsInstance(data, DictFieldData)
@attr('shard_1')
@attr(shard=1)
class ResolveDottedTests(unittest.TestCase):
"""
Tests for `resolve_dotted`.

Some files were not shown because too many files have changed in this diff Show More