|
7 | 7 | from openedx_catalog import api as catalog_api |
8 | 8 | from openedx_catalog.models_api import CatalogCourse, CourseRun |
9 | 9 |
|
10 | | -from cms.djangoapps.contentstore.views.course import rerun_course |
| 10 | +from openedx.core.djangolib.testing.utils import skip_unless_cms |
11 | 11 | from xmodule.modulestore import ModuleStoreEnum |
12 | 12 | from xmodule.modulestore.tests.django_utils import ( |
13 | 13 | TEST_DATA_ONLY_SPLIT_MODULESTORE_DRAFT_PREFERRED, |
|
17 | 17 | from xmodule.modulestore.tests.factories import CourseFactory |
18 | 18 |
|
19 | 19 |
|
| 20 | +@skip_unless_cms |
20 | 21 | class CourseOverviewSyncTestCase(ImmediateOnCommitMixin, ModuleStoreTestCase): |
21 | 22 | """ |
22 | 23 | Test that changes to courses get synced into the new openedx_catalog models. |
@@ -112,6 +113,8 @@ def test_courserun_of_many_sync(self) -> None: |
112 | 113 | but if there are several runs of the same course, the changes don't |
113 | 114 | propagate to the `CatalogCourse` and only affect the `CourseRun. |
114 | 115 | """ |
| 116 | + # This import causes problems at top level when tests run on the LMS shard |
| 117 | + from cms.djangoapps.contentstore.views.course import rerun_course |
115 | 118 | # Create a course |
116 | 119 | course = CourseFactory.create(display_name="Intro to Testing", emit_signals=True) |
117 | 120 | course_id = course.location.context_key |
@@ -153,6 +156,8 @@ def test_courserun_deletion(self) -> None: |
153 | 156 | Tests that when a course run is deleted, the corresponding CourseRun is |
154 | 157 | deleted, and when it's the last run, the CatalogCourse is deleted too. |
155 | 158 | """ |
| 159 | + # This import causes problems at top level when tests run on the LMS shard |
| 160 | + from cms.djangoapps.contentstore.views.course import rerun_course |
156 | 161 | # Create a course with two runs: |
157 | 162 | course = CourseFactory.create(display_name="Intro to Testing", emit_signals=True) |
158 | 163 | course_id1 = course.location.context_key |
|
0 commit comments