Skip to content

Commit

Permalink
build: program fixtures now exclude language tags
Browse files Browse the repository at this point in the history
(also hopefully exclude their translations)
rationale is that the languages are created primarily through
migrations (which is a weird practice for picklist tables, y'all!), so
it's not really necessary to recreate them. I'm a bit worried about
that approach, though, since not all languages defined in production
discovery are created on a fresh provision, but it seems very likely
that this will cover our use case so /shrug
  • Loading branch information
Matt Hughes authored and matthugs committed Nov 4, 2021
1 parent 6a62703 commit 627b71b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from course_discovery.apps.edx_catalog_extensions.api.v1.views import (
DistinctCountsAggregateSearchViewSet, ProgramFixtureView
)
from course_discovery.apps.ietf_language_tags.models import LanguageTag


class DistinctCountsAggregateSearchViewSetTests(SerializationMixin, LoginMixin,
Expand Down Expand Up @@ -356,7 +355,6 @@ def test_200(self):
LevelType: (5, 15),
LevelTypeTranslation: (1, 100),
Video: (20, 60),
LanguageTag: (10, 30),
}

actual_appearances_by_model_label = defaultdict(set)
Expand Down
3 changes: 2 additions & 1 deletion course_discovery/apps/edx_catalog_extensions/api/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
)
from course_discovery.apps.edx_catalog_extensions.api.serializers import DistinctCountsAggregateFacetSearchSerializer
from course_discovery.apps.edx_elasticsearch_dsl_extensions.distinct_counts.query import DistinctCountsSearchQuerySet
from course_discovery.apps.ietf_language_tags.models import LanguageTag

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -143,7 +144,7 @@ def load_program_fixture(programs):
CourseRun: set(course_run_pks),
CurriculumCourseRunExclusion: set(exclusion_pks),
}
excluded_models = {Site, Partner, User}
excluded_models = {Site, Partner, User, LanguageTag}
return load_related(pks_to_load, excluded_models)


Expand Down

0 comments on commit 627b71b

Please sign in to comment.