diff --git a/course_discovery/apps/course_metadata/management/commands/populate_executive_education_data_csv.py b/course_discovery/apps/course_metadata/management/commands/populate_executive_education_data_csv.py index 7248a1f1fd..4c2c960eee 100644 --- a/course_discovery/apps/course_metadata/management/commands/populate_executive_education_data_csv.py +++ b/course_discovery/apps/course_metadata/management/commands/populate_executive_education_data_csv.py @@ -176,7 +176,7 @@ def get_variants(self, product): Returns: list: A list of variant dicts """ - variant_keys = ['variant', 'variants', 'future_variants', 'custom_presentations'] + variant_keys = ['variant', 'variants', 'futureVariants', 'customPresentations'] variants = [] for key in variant_keys: diff --git a/course_discovery/apps/course_metadata/management/commands/tests/test_populate_executive_education_data_csv.py b/course_discovery/apps/course_metadata/management/commands/tests/test_populate_executive_education_data_csv.py index 57c4c7f21b..bc57818961 100644 --- a/course_discovery/apps/course_metadata/management/commands/tests/test_populate_executive_education_data_csv.py +++ b/course_discovery/apps/course_metadata/management/commands/tests/test_populate_executive_education_data_csv.py @@ -148,8 +148,8 @@ class TestPopulateExecutiveEducationDataCsv(CSVLoaderMixin, TestCase): SUCCESS_API_RESPONSE_CUSTOM_AND_FUTURE_VARIANTS = copy.deepcopy(SUCCESS_API_RESPONSE) SUCCESS_API_RESPONSE_CUSTOM_AND_FUTURE_VARIANTS['products'][0].update({ - 'custom_presentations': [{**copy.deepcopy(variant_1), 'websiteVisibility': 'private', 'status': 'active'}], - 'future_variants': [ + 'customPresentations': [{**copy.deepcopy(variant_1), 'websiteVisibility': 'private', 'status': 'active'}], + 'futureVariants': [ { **copy.deepcopy(variant_2), 'websiteVisibility': 'public', 'status': 'scheduled', 'startDate': '2026-03-20', 'endDate': '2026-04-28', 'finalRegCloseDate': '2026-03-26' @@ -264,10 +264,10 @@ def test_populate_executive_education_data_csv_with_new_variants_structure_chang ) simple_variant = self.SUCCESS_API_RESPONSE_CUSTOM_AND_FUTURE_VARIANTS["products"][0]["variant"] - future_variant = self.SUCCESS_API_RESPONSE_CUSTOM_AND_FUTURE_VARIANTS["products"][0]["future_variants"][0] + future_variant = self.SUCCESS_API_RESPONSE_CUSTOM_AND_FUTURE_VARIANTS["products"][0]["futureVariants"][0] custom_variant = self.SUCCESS_API_RESPONSE_CUSTOM_AND_FUTURE_VARIANTS[ "products" - ][0]["custom_presentations"][0] + ][0]["customPresentations"][0] with open(output_csv.name, "r") as csv_file: reader = csv.DictReader(csv_file) @@ -284,6 +284,7 @@ def test_populate_executive_education_data_csv_with_new_variants_structure_chang assert data_row["Start Date"] == future_variant["startDate"] assert data_row["End Date"] == future_variant["endDate"] assert data_row["Reg Close Date"] == future_variant["finalRegCloseDate"] + assert data_row["Publish Date"] == future_variant["startDate"] assert data_row["Restriction Type"] == "None" data_row = next(reader) @@ -291,6 +292,7 @@ def test_populate_executive_education_data_csv_with_new_variants_structure_chang assert data_row["Start Date"] == custom_variant["startDate"] assert data_row["End Date"] == custom_variant["endDate"] assert data_row["Reg Close Date"] == custom_variant["finalRegCloseDate"] + assert data_row["Publish Date"] == str(date.today().isoformat()) assert data_row["Restriction Type"] == "custom-b2b-enterprise" @mock.patch('course_discovery.apps.course_metadata.utils.GetSmarterEnterpriseApiClient')