From 555fc4d296ca921bfba33ca6148173fd9665beb5 Mon Sep 17 00:00:00 2001 From: Troy Sankey Date: Fri, 18 Oct 2024 12:49:32 -0700 Subject: [PATCH] docs: update test data script for testing restricted runs --- scripts/setup_restricted_runs_test_courses.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/setup_restricted_runs_test_courses.py b/scripts/setup_restricted_runs_test_courses.py index 3f9055a4..d3181bf7 100644 --- a/scripts/setup_restricted_runs_test_courses.py +++ b/scripts/setup_restricted_runs_test_courses.py @@ -153,3 +153,19 @@ course=restricted_course_unicorn, run=course_unicorn_run1, )[0]) + +# Finally update the catalog query content filters to reflect the relationships +# ============================================================================= +catalog_query.content_filter |= { + 'restricted_runs_allowed': { + f'course:{course_mixed.content_key}': [course_mixed_run2.content_key], + f'course:{course_unicorn.content_key}': [course_mixed_run1.content_key], + }, +} +catalog_query.save() +catalog_query_2.content_filter |= { + 'restricted_runs_allowed': { + f'course:{course_mixed.content_key}': [course_mixed_run3.content_key], + }, +} +catalog_query_2.save()