Skip to content

Commit be726d3

Browse files
test: fix issue with the tests running on CI
1 parent 2902fe8 commit be726d3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

openedx/core/djangoapps/content/course_overviews/tests/test_sync_with_openedx_catalog.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from openedx_catalog import api as catalog_api
88
from openedx_catalog.models_api import CatalogCourse, CourseRun
99

10-
from cms.djangoapps.contentstore.views.course import rerun_course
10+
from openedx.core.djangolib.testing.utils import skip_unless_cms
1111
from xmodule.modulestore import ModuleStoreEnum
1212
from xmodule.modulestore.tests.django_utils import (
1313
TEST_DATA_ONLY_SPLIT_MODULESTORE_DRAFT_PREFERRED,
@@ -17,6 +17,7 @@
1717
from xmodule.modulestore.tests.factories import CourseFactory
1818

1919

20+
@skip_unless_cms
2021
class CourseOverviewSyncTestCase(ImmediateOnCommitMixin, ModuleStoreTestCase):
2122
"""
2223
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:
112113
but if there are several runs of the same course, the changes don't
113114
propagate to the `CatalogCourse` and only affect the `CourseRun.
114115
"""
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
115118
# Create a course
116119
course = CourseFactory.create(display_name="Intro to Testing", emit_signals=True)
117120
course_id = course.location.context_key
@@ -153,6 +156,8 @@ def test_courserun_deletion(self) -> None:
153156
Tests that when a course run is deleted, the corresponding CourseRun is
154157
deleted, and when it's the last run, the CatalogCourse is deleted too.
155158
"""
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
156161
# Create a course with two runs:
157162
course = CourseFactory.create(display_name="Intro to Testing", emit_signals=True)
158163
course_id1 = course.location.context_key

0 commit comments

Comments
 (0)