refactor: Move content_tagging django app so that CMS-only tests run (#33259)
This commit is contained in:
2
.github/workflows/pylint-checks.yml
vendored
2
.github/workflows/pylint-checks.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
||||
- module-name: openedx-1
|
||||
path: "--django-settings-module=lms.envs.test openedx/core/types/ openedx/core/djangoapps/ace_common/ openedx/core/djangoapps/agreements/ openedx/core/djangoapps/api_admin/ openedx/core/djangoapps/auth_exchange/ openedx/core/djangoapps/bookmarks/ openedx/core/djangoapps/cache_toolbox/ openedx/core/djangoapps/catalog/ openedx/core/djangoapps/ccxcon/ openedx/core/djangoapps/commerce/ openedx/core/djangoapps/common_initialization/ openedx/core/djangoapps/common_views/ openedx/core/djangoapps/config_model_utils/ openedx/core/djangoapps/content/ openedx/core/djangoapps/content_libraries/ openedx/core/djangoapps/content_staging/ openedx/core/djangoapps/contentserver/ openedx/core/djangoapps/cookie_metadata/ openedx/core/djangoapps/cors_csrf/ openedx/core/djangoapps/course_apps/ openedx/core/djangoapps/course_date_signals/ openedx/core/djangoapps/course_groups/ openedx/core/djangoapps/courseware_api/ openedx/core/djangoapps/crawlers/ openedx/core/djangoapps/credentials/ openedx/core/djangoapps/credit/ openedx/core/djangoapps/dark_lang/ openedx/core/djangoapps/debug/ openedx/core/djangoapps/demographics/ openedx/core/djangoapps/discussions/ openedx/core/djangoapps/django_comment_common/ openedx/core/djangoapps/embargo/ openedx/core/djangoapps/enrollments/ openedx/core/djangoapps/external_user_ids/ openedx/core/djangoapps/zendesk_proxy/ openedx/core/djangolib/ openedx/core/lib/ openedx/core/tests/ openedx/core/djangoapps/course_live/"
|
||||
- module-name: openedx-2
|
||||
path: "--django-settings-module=lms.envs.test openedx/core/djangoapps/geoinfo/ openedx/core/djangoapps/header_control/ openedx/core/djangoapps/heartbeat/ openedx/core/djangoapps/lang_pref/ openedx/core/djangoapps/models/ openedx/core/djangoapps/monkey_patch/ openedx/core/djangoapps/oauth_dispatch/ openedx/core/djangoapps/olx_rest_api/ openedx/core/djangoapps/password_policy/ openedx/core/djangoapps/plugin_api/ openedx/core/djangoapps/plugins/ openedx/core/djangoapps/profile_images/ openedx/core/djangoapps/programs/ openedx/core/djangoapps/safe_sessions/ openedx/core/djangoapps/schedules/ openedx/core/djangoapps/service_status/ openedx/core/djangoapps/session_inactivity_timeout/ openedx/core/djangoapps/signals/ openedx/core/djangoapps/site_configuration/ openedx/core/djangoapps/system_wide_roles/ openedx/core/djangoapps/theming/ openedx/core/djangoapps/user_api/ openedx/core/djangoapps/user_authn/ openedx/core/djangoapps/util/ openedx/core/djangoapps/verified_track_content/ openedx/core/djangoapps/video_config/ openedx/core/djangoapps/video_pipeline/ openedx/core/djangoapps/waffle_utils/ openedx/core/djangoapps/xblock/ openedx/core/djangoapps/xmodule_django/ openedx/core/tests/ openedx/features/ openedx/testing/ openedx/tests/ openedx/core/djangoapps/learner_pathway/ openedx/core/djangoapps/notifications/ openedx/core/djangoapps/staticfiles/"
|
||||
path: "--django-settings-module=lms.envs.test openedx/core/djangoapps/geoinfo/ openedx/core/djangoapps/header_control/ openedx/core/djangoapps/heartbeat/ openedx/core/djangoapps/lang_pref/ openedx/core/djangoapps/models/ openedx/core/djangoapps/monkey_patch/ openedx/core/djangoapps/oauth_dispatch/ openedx/core/djangoapps/olx_rest_api/ openedx/core/djangoapps/password_policy/ openedx/core/djangoapps/plugin_api/ openedx/core/djangoapps/plugins/ openedx/core/djangoapps/profile_images/ openedx/core/djangoapps/programs/ openedx/core/djangoapps/safe_sessions/ openedx/core/djangoapps/schedules/ openedx/core/djangoapps/service_status/ openedx/core/djangoapps/session_inactivity_timeout/ openedx/core/djangoapps/signals/ openedx/core/djangoapps/site_configuration/ openedx/core/djangoapps/system_wide_roles/ openedx/core/djangoapps/theming/ openedx/core/djangoapps/user_api/ openedx/core/djangoapps/user_authn/ openedx/core/djangoapps/util/ openedx/core/djangoapps/verified_track_content/ openedx/core/djangoapps/video_config/ openedx/core/djangoapps/video_pipeline/ openedx/core/djangoapps/waffle_utils/ openedx/core/djangoapps/xblock/ openedx/core/djangoapps/xmodule_django/ openedx/core/tests/ openedx/features/ openedx/testing/ openedx/tests/ openedx/core/djangoapps/learner_pathway/ openedx/core/djangoapps/notifications/ openedx/core/djangoapps/staticfiles/ openedx/core/djangoapps/content_tagging/"
|
||||
- module-name: common
|
||||
path: "--django-settings-module=lms.envs.test common"
|
||||
- module-name: cms
|
||||
|
||||
1
.github/workflows/unit-test-shards.json
vendored
1
.github/workflows/unit-test-shards.json
vendored
@@ -200,6 +200,7 @@
|
||||
"openedx-4": {
|
||||
"settings": "cms.envs.test",
|
||||
"paths": [
|
||||
"openedx/core/djangoapps/content_tagging/",
|
||||
"openedx/core/djangoapps/geoinfo/",
|
||||
"openedx/core/djangoapps/header_control/",
|
||||
"openedx/core/djangoapps/heartbeat/",
|
||||
|
||||
@@ -1752,7 +1752,7 @@ INSTALLED_APPS = [
|
||||
|
||||
# Tagging
|
||||
'openedx_tagging.core.tagging.apps.TaggingConfig',
|
||||
'openedx.features.content_tagging',
|
||||
'openedx.core.djangoapps.content_tagging',
|
||||
|
||||
'openedx.features.course_duration_limits',
|
||||
'openedx.features.content_type_gating',
|
||||
|
||||
@@ -339,7 +339,7 @@ urlpatterns += [
|
||||
|
||||
# Content tagging
|
||||
urlpatterns += [
|
||||
path('api/content_tagging/', include(('openedx.features.content_tagging.urls'))),
|
||||
path('api/content_tagging/', include(('openedx.core.djangoapps.content_tagging.urls'))),
|
||||
]
|
||||
|
||||
# studio-content-api specific API docs (using drf-spectacular and openapi-v3)
|
||||
|
||||
@@ -3230,7 +3230,7 @@ INSTALLED_APPS = [
|
||||
|
||||
# Tagging
|
||||
'openedx_tagging.core.tagging.apps.TaggingConfig',
|
||||
'openedx.features.content_tagging',
|
||||
'openedx.core.djangoapps.content_tagging',
|
||||
|
||||
# Features
|
||||
'openedx.features.calendar_sync',
|
||||
|
||||
@@ -9,7 +9,7 @@ class ContentTaggingConfig(AppConfig):
|
||||
"""App config for the content tagging feature"""
|
||||
|
||||
default_auto_field = "django.db.models.BigAutoField"
|
||||
name = "openedx.features.content_tagging"
|
||||
name = "openedx.core.djangoapps.content_tagging"
|
||||
|
||||
def ready(self):
|
||||
# Connect signal handlers
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated by Django 3.2.20 on 2023-07-31 21:07
|
||||
|
||||
from django.db import migrations
|
||||
import openedx.features.content_tagging.models.base
|
||||
import openedx.core.djangoapps.content_tagging.models.base
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -21,7 +21,7 @@ class Migration(migrations.Migration):
|
||||
'indexes': [],
|
||||
'constraints': [],
|
||||
},
|
||||
bases=(openedx.features.content_tagging.models.base.ContentTaxonomyMixin, 'oel_tagging.usersystemdefinedtaxonomy'),
|
||||
bases=(openedx.core.djangoapps.content_tagging.models.base.ContentTaxonomyMixin, 'oel_tagging.usersystemdefinedtaxonomy'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ContentLanguageTaxonomy',
|
||||
@@ -32,7 +32,7 @@ class Migration(migrations.Migration):
|
||||
'indexes': [],
|
||||
'constraints': [],
|
||||
},
|
||||
bases=(openedx.features.content_tagging.models.base.ContentTaxonomyMixin, 'oel_tagging.languagetaxonomy'),
|
||||
bases=(openedx.core.djangoapps.content_tagging.models.base.ContentTaxonomyMixin, 'oel_tagging.languagetaxonomy'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ContentOrganizationTaxonomy',
|
||||
@@ -43,7 +43,7 @@ class Migration(migrations.Migration):
|
||||
'indexes': [],
|
||||
'constraints': [],
|
||||
},
|
||||
bases=(openedx.features.content_tagging.models.base.ContentTaxonomyMixin, 'oel_tagging.modelsystemdefinedtaxonomy'),
|
||||
bases=(openedx.core.djangoapps.content_tagging.models.base.ContentTaxonomyMixin, 'oel_tagging.modelsystemdefinedtaxonomy'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='OrganizationModelObjectTag',
|
||||
@@ -17,8 +17,8 @@ from rest_framework.test import APITestCase
|
||||
|
||||
from common.djangoapps.student.auth import add_users, update_org_role
|
||||
from common.djangoapps.student.roles import CourseStaffRole, OrgContentCreatorRole
|
||||
from openedx.core.djangoapps.content_tagging.models import TaxonomyOrg
|
||||
from openedx.core.djangolib.testing.utils import skip_unless_cms
|
||||
from openedx.features.content_tagging.models import TaxonomyOrg
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
@@ -13,7 +13,7 @@ from organizations.models import Organization
|
||||
|
||||
from common.djangoapps.student.tests.factories import UserFactory
|
||||
from openedx.core.djangolib.testing.utils import skip_unless_cms
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_MODULESTORE, ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, ModuleStoreTestCase
|
||||
|
||||
from .. import api
|
||||
from ..models import ContentLanguageTaxonomy, TaxonomyOrg
|
||||
@@ -29,7 +29,7 @@ class TestAutoTagging(ModuleStoreTestCase):
|
||||
Test if the Course and XBlock tags are automatically created
|
||||
"""
|
||||
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_SPLIT_MODULESTORE
|
||||
|
||||
def _check_tag(self, object_id: str, taxonomy_id: int, value: str | None):
|
||||
"""
|
||||
@@ -69,7 +69,7 @@ class TestAutoTagging(ModuleStoreTestCase):
|
||||
self.user_id = self.user.id
|
||||
|
||||
self.orgA = Organization.objects.create(name="Organization A", short_name="orgA")
|
||||
self.patcher = patch("openedx.features.content_tagging.tasks.modulestore", return_value=self.store)
|
||||
self.patcher = patch("openedx.core.djangoapps.content_tagging.tasks.modulestore", return_value=self.store)
|
||||
self.addCleanup(self.patcher.stop)
|
||||
self.patcher.start()
|
||||
|
||||
Reference in New Issue
Block a user